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 / femacs
Last active August 29, 2015 14:10
find and open in emacs
#! /bin/bash
# Place this file somewhere in your $PATH and chmod +x it!
function usage () {
echo "Usage:"
echo "femacs is 'find and open in emacs'"
echo "femacs requires 1 parameter. It basically does:"
echo " emacs \`find . -name [expression]\`";
}
@nacho4d
nacho4d / tangotangolight-theme.el
Created July 29, 2014 10:24
tangotangolight-theme.el
;;; tangotangolight-theme.el --- Tango Palette color theme for Emacs 24.
;; First derived from color-theme-tango.el, created by danranx@gmail.com :
;; http://www.emacswiki.org/emacs/color-theme-tango.el
;; Copyright (C) 2011, 2012, 2013 Julien Barnier <julien@nozav.org>
;; Author: Julien Barnier
;; Adapted-By: Yesudeep Mangalapilly
;; Keywords: tango palette color theme emacs
@nacho4d
nacho4d / .profile
Last active August 29, 2015 13:58
Genereal coloriser configuration file for Android Debug Bridge: Create a file in `~/.grc/conf.adb` and add adb entry to `/usr/local/etc/grc.conf`
# Add path for Android
export ANDROID_HOME=$HOME/Downloads/adt-bundle-mac-x86_64-20140321/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
@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 ()
@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 / .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 / 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 / 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 / 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 / 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 ---