Skip to content

Instantly share code, notes, and snippets.

View nacho4d's full-sized avatar

Guillermo Ignacio Enriquez Gutierrez nacho4d

View GitHub Profile
@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 / 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
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 / installDocumentation.sh
Created February 19, 2013 08:11
Install *.docset files
#!/bin/sh
#
# Description:
# Installs the given *.docset so it is visible by Xcode, Dash, etc
#
# Usage:
# installDocumentation path/to/documentation.docset
#
# Check parameters
@nacho4d
nacho4d / checkXcodeSelect.sh
Last active December 13, 2015 22:19
Check xcode-select is installed and get Xcode path
# Check xcode-select to check Xcode + Developer tools are installed
command -v xcode-select >/dev/null 2>&1 || { echo >&2 "Make sure Xcode together with xcode-select command is installed. Aborting."; exit 1; }
XCODE_PATH=$(xcode-select --print-path 2>&1)
echo $XCODE_PATH
@nacho4d
nacho4d / .bash_profile
Last active December 9, 2015 19:48
~/.bash_profile
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
export LS_COLORS=$LSCOLORS
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
#PS1='\[\e[0;33m\][\h:\W \u]$\[\e[m\] '
PS1='\[\e[0;33m\][\w]$\[\e[m\] '
@nacho4d
nacho4d / ShareFromSafari.scpt
Created November 16, 2012 11:08
Share from Safari
#!/usr/bin/osascript
-- Adaptation of @piyomaru 's
-- http://piyocast.com/as/archives/2142#comment-37021
-- socialItem: "Twitter", "Facebook", "Message"
on composePost(socialItem)
try
set postText to ""
@nacho4d
nacho4d / Typescript.sublime-build
Created October 19, 2012 08:59
Typescript sublime text build system file
{
"cmd": ["tsc","$file"],
"file_regex": "^(.+) \\((\\d+),(\\d+)\\): (.+)$",
"selector": "source.ts",
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
}
}
@nacho4d
nacho4d / JSLint.sublime-build
Created October 15, 2012 15:54
JSLint sublime text build system file
{
"cmd": ["jsl", "-process", "$file", "-nologo", "-nocontext", "-nofilelisting"],
"file_regex": "^(.+\\.js)\\((\\d+)\\): (.+)$",
"selector": "source.js",
"osx": {
"path": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
}
}
// Above settings are for output of the form:
@nacho4d
nacho4d / UIAutocorrectionInlinePrompt-Dismiss.m
Created October 8, 2012 07:11
Dismiss the UIAutocorrectionInlinePrompt manually - Private API
// Find and dismiss the UIAutocorrectionInlinePrompt view
// target is an instance of UITextView
NSArray *textviewSubviews = [target subviews];
NSInteger correctionViewIndex = [textviewSubviews indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
if ([[[obj class] description] isEqualToString:@"UIAutocorrectInlinePrompt"]) {
*stop = YES;
return YES;
} else {
return NO;
}