Skip to content

Instantly share code, notes, and snippets.

View leopic's full-sized avatar

Leo Picado leopic

View GitHub Profile
@leopic
leopic / inUrl.js
Created September 24, 2013 04:53 — forked from albemuth/inUrl.js
_.mixin({
inUrlDry: function(singleParam) {
//en vez de usar un arreglo para manegar los keys, vals se crea un map, así
//se puede accesar directamente en vez de tener que buscar con index of,
//esa parte pasa de O(n) a O(1) primero se hace un arreglo que tiene una
//estructura así: [[param, {decodedValue: 'val', rawValue: 'val'}]...] y el
//metodo _.object pasa de eso a
//{param: {decodedValue: 'val', rawValue: 'val'}}
var paramMap = _.chain(location.search.slice(1).split('&'))

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"

Configure Apache Path Environment Variable on Mac OSX

Problem: Apache2/PHP did not find a program to execute on its configured path

Solution: Add a new path of /usr/local/bin to Apache2's path where the program was installed

  1. Edit the Apache2 plist file with whatever editor you like (example using vim):

     $ sudo vim /System/Library/LaunchDaemons/org.apache.httpd.plist
    
@leopic
leopic / ForegroundUtils.java
Created April 13, 2016 22:11 — forked from PiXeL16/ForegroundUtils.java
Singleton Util that share the status of the App when it goes to background or foreground
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;