Friday, March 25, 2016

Converting Between Hexadecimal Values and Characters

Command:

$ echo -n "織田信長" | hexdump

Output:

0000000 e7 b9 94 e7 94 b0 e4 bf a1 e9 95 b7          
000000c

Hexadecimal Values to Multibyte Characters:

$ echo -e "\xE7\xB9\x94\xE7\x94\xB0\xE4\xBF\xA1\xE9\x95\xB7"

Output:

織田信長

Apple TV : The Kiss

Miki Nakatani (中谷美紀):砂の果実

Wednesday, March 23, 2016

npm: Using npm Package Manager for Node.js to Install Node Module Lodash

Installation command:
$ npm install lodash

index.js:

var lodash = require('lodash');
var output = lodash.without([1, 2, 3], 1);
console.log(output);

Executing index.js:

[ 2, 3 ]

Alcatraz: Installing Package Manager for XCode

$ curl -fsSL https://raw.githubusercontent.com/supermarin/Alcatraz/deploy/Scripts/install.sh | sh

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   590    0   590    0     0    241      0 --:--:--  0:00:02 --:--:--   241
  0     0    0     0    0     0      0      0 --:--:--  0:00:04 --:--:--     0x ./._Alcatraz.xcplugin
x Alcatraz.xcplugin/
x Alcatraz.xcplugin/._Contents
x Alcatraz.xcplugin/Contents/
x Alcatraz.xcplugin/Contents/._Info.plist
x Alcatraz.xcplugin/Contents/Info.plist
x Alcatraz.xcplugin/Contents/._MacOS
x Alcatraz.xcplugin/Contents/MacOS/
x Alcatraz.xcplugin/Contents/._Resources
x Alcatraz.xcplugin/Contents/Resources/
x Alcatraz.xcplugin/Contents/Resources/._ATZPackageListTableCellView.nib
x Alcatraz.xcplugin/Contents/Resources/ATZPackageListTableCellView.nib
x Alcatraz.xcplugin/Contents/Resources/._ATZPluginWindowController.nib
x Alcatraz.xcplugin/Contents/Resources/ATZPluginWindowController.nib
x Alcatraz.xcplugin/Contents/Resources/._bitbucket_grayscale.tiff
x Alcatraz.xcplugin/Contents/Resources/bitbucket_grayscale.tiff
x Alcatraz.xcplugin/Contents/Resources/._en.lproj
x Alcatraz.xcplugin/Contents/Resources/en.lproj/
x Alcatraz.xcplugin/Contents/Resources/._eye_icon.tiff
x Alcatraz.xcplugin/Contents/Resources/eye_icon.tiff
x Alcatraz.xcplugin/Contents/Resources/._git_grayscale.tiff
x Alcatraz.xcplugin/Contents/Resources/git_grayscale.tiff
x Alcatraz.xcplugin/Contents/Resources/._github_grayscale.tiff
x Alcatraz.xcplugin/Contents/Resources/github_grayscale.tiff
x Alcatraz.xcplugin/Contents/Resources/._link_icon.tiff
x Alcatraz.xcplugin/Contents/Resources/link_icon.tiff
x Alcatraz.xcplugin/Contents/Resources/en.lproj/._InfoPlist.strings
x Alcatraz.xcplugin/Contents/Resources/en.lproj/InfoPlist.strings
x Alcatraz.xcplugin/Contents/Resources/en.lproj/._Localizable.strings
x Alcatraz.xcplugin/Contents/Resources/en.lproj/Localizable.strings
x Alcatraz.xcplugin/Contents/MacOS/._Alcatraz
100  111k  100  111k    0     0  21189      0  0:00:05  0:00:05 --:--:-- 56028


Alcatraz successfully installed!!1!🍻  Please restart your Xcode (7.2.1).

Monday, March 21, 2016

AppleScript: Opening iCloud Documents (Numbers)

set the defaultDestinationFolder to (path to desktop folder)
set filePath to (path to library folder from user domain as text) & "Mobile Documents:com~apple~Numbers:Documents:test.numbers"

tell application "Numbers"
activate
    try
        open file filePath
    end try
end tell

Homebrew: Installing Mercurial (hg) (Distributed Version Control)

Command:

$ brew install mercurial

Homebrew: Installing SDI (Simple DirectMedia Layer)

Command:

$ brew install sdl sdl_image sdl_mixer sdl_ttf portmidi

Homebrew: link

Command:

$ brew link python3

Result:

Linking /usr/local/Cellar/python3/3.5.1... 19 symlinks created

Homebrew: doctor

Command:

$ brew doctor

Result:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: /usr/local/lib isn't writable.

This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a formula tries to write a file to this directory, the
install will fail during the link step.

You should probably change the ownership and permissions of /usr/local/lib
back to your user account.
  sudo chown -R $(whoami) /usr/local/lib

Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.

You should probably `sudo chown -R $(whoami)` them:
    /usr/local/share/man/man3

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

pip: Installing pip (Package Manager for Python) on OS X Using easy_install

Command:

$ sudo easy_install pip

Result:

Password:
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 8.1.1
Downloading https://pypi.python.org/packages/source/p/pip/pip-8.1.1.tar.gz#md5=6b86f11841e89c8241d689956ba99ed7
Processing pip-8.1.1.tar.gz
Writing /tmp/easy_install-1rbqCh/pip-8.1.1/setup.cfg
Running pip-8.1.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-1rbqCh/pip-8.1.1/egg-dist-tmp-OTECPf
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'
no previously-included directories found matching 'contrib'
no previously-included directories found matching 'tasks'
no previously-included directories found matching 'tests'
Adding pip 8.1.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg
Processing dependencies for pip

Finished processing dependencies for pip