Skip to content

Instantly share code, notes, and snippets.

View goopi's full-sized avatar

Gustavo Leguizamon goopi

  • Buenos Aires, Argentina
View GitHub Profile
$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install fabric

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@goopi
goopi / img2base64string.md
Created January 21, 2013 02:07
Base64 encoding of image files
Base64 encoding of image files
$ openssl enc -base64 -in /path/to/image/image.png -out /path/to/image/string_image.b64
$ sed -i '' -e :a -e '$!N;s/\n//;ta' string_image.b64
$ sed -i '' '1s/^/data:image\/png;base64,/' string_image.b64
@goopi
goopi / ios-device-type.m
Last active December 12, 2015 00:38
iOS detect device type #ios
#define IS_IPHONE ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
#define IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
#define IS_HEIGHT_GTE_568 ([[UIScreen mainScreen] bounds].size.height >= 568.0f && [UIScreen mainScreen].scale == 2.f)
#define IS_IPHONE_5 (IS_IPHONE && IS_HEIGHT_GTE_568)
@goopi
goopi / UIColor+HexColor.h
Last active December 12, 2015 04:39
UIColor+HexColor #ios
@interface UIColor (HexColor)
+ (UIColor *)colorWithHex:(NSString *)hexString;
@end
@goopi
goopi / ios-simulator-alias.sh
Last active December 12, 2015 06:59
iPhone Simulator bash alias #ios
alias ios='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
@goopi
goopi / leiningen2-install.md
Last active December 14, 2015 11:19
Installing Leiningen 2 #clojure

Installing Leiningen 2

$ mkdir ~/.lein
$ mkdir ~/.lein/bin

$ wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
$ chmod a+x lein
$ mv lein ~/.lein/bin/lein
@goopi
goopi / css-img-replacement.md
Last active December 14, 2015 14:38
CSS Image Replacement

CSS Image Replacement Techniques

Negative Text Indent
.ir {
  overflow: hidden;
  text-indent: -9999px;
}

The Elements of Programming Style

The following rules of programming style are excerpted from the book "The Elements of Programming Style" by Kernighan and Plauger, published by McGraw Hill. Here is quote from the book: "To paraphrase an observation in The Elements of Style by Strunk and White, the rules of programming style, like those of English, are sometimes broken, even by the best writers. When a rule is broken, however, you will usually find in the program some compensating merit, attained at the cost of the violation. Unless you are certain of doing as well, you will probably do best to follow the rules."

@goopi
goopi / vim-patch-fonts.md
Last active December 15, 2015 08:19
Vim-powerline - patch fonts #vim

vim-powerline - patch fonts

Install XQuartz

XQuartz

Install FontForge with Python extension

$ brew install https://raw.github.com/ummels/homebrew/fontforge/Library/Formula/fontforge.rb