Skip to content

Instantly share code, notes, and snippets.

View carloscasalar's full-sized avatar
💜
Helping make cities a better place to live at @cabify

Carlos Castillo carloscasalar

💜
Helping make cities a better place to live at @cabify
View GitHub Profile
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@bloudermilk
bloudermilk / README.md
Created March 23, 2012 19:07
Facebook Page Categories

All of the categories!

I wrote a really simple JavaScript script that uses jQuery to extract all the categories from Facebook's "Create a page" page.

Instructions

  1. Navigate to the Create a page page.
  2. jQuerify the page.
  3. Open up your JavaScript console of choice and run the following script:
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

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 "your_email@youremail.com"
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@mweibel
mweibel / passport-mock.js
Last active December 5, 2022 03:33
Mock passport.js with an own strategy
/**
* Author: Michael Weibel <michael.weibel@gmail.com>
* License: MIT
*/
var passport = require('passport')
, StrategyMock = require('./strategy-mock');
module.exports = function(app, options) {
// create your verify function on your own -- should do similar things as
@afgomez
afgomez / validate_spanish_id.js
Last active April 22, 2024 07:08
Spanish DNI, CIF, NIE validator
/**
* ValidateSpanishID. Returns the type of document and checks its validity.
*
* Usage:
* ValidateSpanishID( str );
*
* > ValidateSpanishID( '12345678Z' );
* // { type: 'dni', valid: true }
*
* > ValidateSpanishID( 'B83375575' );
@gmilby
gmilby / createUUID.js
Created September 18, 2013 16:46
angular - create unique id
angular
.module('uuidApp', ['lvl.services'])
.controller('uuidCtl', ['$scope', 'uuid', function($scope, uuid){
$scope.generateUuid = function() {
$scope.new = uuid.new();
$scope.nInfo = new Date();
};
$scope.showEmpty = function() {
$scope.empty = uuid.empty();
@mschmulen
mschmulen / README.md
Last active August 23, 2022 22:42 — forked from anonymous/README.md
LoopBack cheat sheet. git clone https://gist.github.com/6740321.git LoopBackCheatSheet

#LoopBack cheat sheet

##Recipies

LoopBack from api-example

Instantiate the sls-sample-app

slc example
cd sls-sample-app
slc install