Skip to content

Instantly share code, notes, and snippets.

View nacho4d's full-sized avatar

Guillermo Ignacio Enriquez Gutierrez nacho4d

View GitHub Profile
tell application "iPhone Simulator"
activate
end tell
tell application "System Events"
tell process "iPhone Simulator"
tell menu bar 1
tell menu bar item "iOS Simulator"
tell menu "iOS Simulator"
click menu item "Reset Content and Settings…"
@nacho4d
nacho4d / td_completion.sh
Created June 10, 2013 16:37
td_completion
# Taken from http://tldp.org/LDP/abs/html/tabexpansion.html
# file: td_completion
# td-completion.sh parameter-completion
_td_completion_func ()
{
local cur # pointer to current word
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
case "$cur" in
@nacho4d
nacho4d / customreader.css
Last active December 18, 2015 15:48
Style sheet for customreader. p://canisbos.com/customreader
/* http://canisbos.com/customreader */
.page {
width: 70%;
border: none;
padding: 40px 0px;
background-color: #efefef; /* same as article */
color: #000000;
font-family: Georgia !important;
text-rendering: optimizelegibility;
}
@nacho4d
nacho4d / CGImageAlphaInfo&CGBitmapInfo.txt
Last active December 19, 2015 11:28
CGImageAlphaInfo and CGBitmapInfo
Binary Int Name
-- --------- --------- --------- --------- --------- -------- ----------------
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0 kCGImageAlphaNone
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 1 kCGImageAlphaPremultipliedLast
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0010 2 kCGImageAlphaPremultipliedFirst
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0011 3 kCGImageAlphaLast
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0100 4 kCGImageAlphaFirst
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0101 5 kCGImageAlphaNoneSkipLast
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0110 6 kCGImageAlphaNoneSkipLast
0x 0000 0000 0000 0000 0000 0000 0000 0000 0000 0111 7 ---
@nacho4d
nacho4d / tc
Last active December 21, 2015 04:09
Time Converter
#!/bin/bash
function unix_to_days_offset ()
{
echo "($1-1356966000)/(24*3600)" | bc;
}
function unix_to_human ()
{
res=`date -d @$1 "+%Y-%m-%d %H:%M:%S %Z"`;
@nacho4d
nacho4d / gist:7150205
Created October 25, 2013 06:24
UIImage with rounded corners
I created the gist without loging in. Bleh!
https://gist.github.com/anonymous/7150165
@nacho4d
nacho4d / twilight.unity.theme.xml
Last active December 29, 2015 20:00
Another twilight theme but this time for monodevelop (unity) Preview: (link tweet with an image) https://twitter.com/nacho4d/status/406833668783493120
<EditorStyle name="Twilight" _description="Twilight, the TextMate theme">
<!-- Color palette -->
<Color name="tl.general.selection" value="#545454" /> <!-- light gray -->
<Color name="tl.general.background" value="#252525" /> <!-- *light* black -->
<Color name="tl.general.background.dark" value="#191919" /> <!-- not so light black -->
<Color name="tl.plainText" value="#CDCDCD" /> <!-- light gray -->
<Color name="tl.comments" value="#3FA41C" /> <!-- green -->
<Color name="tl.strings" value="#A0AB7F" /> <!-- lime -->
<Color name="tl.sharactersAndNumbers" value="#786DC4" /> <!-- purple -->
<Color name="tl.keywords" value="#C31265" /> <!-- pink-->
@nacho4d
nacho4d / .emacs
Last active November 22, 2016 12:06
My emacs configuration ...
;; Add ~/.elisp directory to my load path.
;; Not needed since .emacs.d is read by default
(add-to-list 'load-path' "~/.emacs.d")
;; Show trailing white spaces
(setq-default show-trailing-whitespace t)
(set-face-background 'trailing-whitespace "#191970")
;; Adds Other Package manager repositories
(require 'package)
@nacho4d
nacho4d / leakingSingleton.m
Last active December 31, 2015 20:28
leaking vs non-leaking singleton
// LEAKING
@implementation CandidatesWindow
CandidatesWindow *sharedInstance = nil;
- (id)initWithFrame:(CGRect)frame
{
if (sharedInstance) {
sharedInstance.frame = frame;
} else {
sharedInstance = [super initWithFrame:frame];
}
@nacho4d
nacho4d / AndroidManifestEditor.sh
Created February 20, 2014 11:03
Edit AndroidManifest.xml using xmlstarlet
#! /bin/bash
set -e;
[ -z "$1" ] && { echo "ERROR: No AndroidManifest.xml provided"; exit 1; }
command -v xmlstarlet >/dev/null 2>&1 || { echo >&2 "ERROR: xmlstarlet command not available"; exit 1; }
MANIFEST_FILE=$1
function addUsesPermission ()