This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.9.0-10/include/ImageMagick-6/wand/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.9.0-10/lib/pkgconfig/ gem install rmagick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Exists reports whether the named file or directory exists. | |
| func Exists(name string) bool { | |
| if _, err := os.Stat(name); err != nil { | |
| if os.IsNotExist(err) { | |
| return false | |
| } | |
| } | |
| return true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| ) | |
| func main() { | |
| var buffer bytes.Buffer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ( | |
| "fmt"; | |
| "strings"; | |
| ) | |
| func main() { | |
| s := []string{"this", "is", "a", "joined", "string\n"}; | |
| fmt.Printf(strings.Join(s, " ")); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add the remote, call it "upstream": | |
| git remote add upstream https://github.com/whoever/whatever.git | |
| # Fetch all the branches of that remote into remote-tracking branches, | |
| # such as upstream/master: | |
| git fetch upstream | |
| # Make sure that you're on your master branch: | |
| git checkout master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GIT_COMMITTER_DATE="`date`" git commit --amend --date "`date`" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brew update && brew upgrade | |
| brew uninstall -all pkgconfig imagemagick | |
| brew install pkgconfig imagemagick | |
| mdfind MagickWand.h | |
| mdfind MagickCore.pc | |
| sudo C_INCLUDE_PATH=<path to wand dir> PKG_CONFIG_PATH=<path to core dir> gem install imagemagick |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Remove xVim: rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/XVim.xcplugin | |
| 2. Checkout the develop branch: git checkout develop | |
| 3. Open the xVim project | |
| 4. Ignore message about GC not being supported. Don't convert to Arc. | |
| 5. Select XCode 5 as your build target. | |
| 6. Set it to Release. | |
| 7. Build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defaults write com.apple.Xcode XCCodeSenseFormattingOptions '{ "BlockSeparator" = "" ; }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void) viewDidLoad { | |
| [super viewDidLoad]; | |
| dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
| //Here your non-main thread. | |
| NSLog (@"Hi, I'm new thread"); | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| //Here you returns to main thread. | |
| NSLog (@"Hi, I'm main thread"); | |
| }); | |
| }); |