Skip to content

Instantly share code, notes, and snippets.

View davidsonfellipe's full-sized avatar
:octocat:
hey ✌🏼

Davidson Fellipe davidsonfellipe

:octocat:
hey ✌🏼
View GitHub Profile
@davidsonfellipe
davidsonfellipe / gist:3782225
Created September 25, 2012 14:21
Install SWI Prolog
stable release:
$ git clone git://www.swi-prolog.org/home/pl/git/pl.git
or
development version:
git://www.swi-prolog.org/home/pl/git/pl-devel.git
$ cd pl-devel
@davidsonfellipe
davidsonfellipe / gist:3791691
Last active October 11, 2015 02:57
setDelay Javascript
var setDelay = (function(){
var timeout = 0;
return function(callback, milliseconds){
clearTimeout (timeout);
timeout = setTimeout(callback, milliseconds);
@davidsonfellipe
davidsonfellipe / gist:3923370
Created October 20, 2012 14:04
Comma Operator
(A && B)
//Always evaluate A
//If A is true, evaluate B
(A || B)
//Always evaluate A
//If A is false, evaluate B
(A, B)
//Always evaluate A
@davidsonfellipe
davidsonfellipe / gist:4529914
Last active December 11, 2015 02:19
install mongodb
if ! which mongod >/dev/null 2>&1 ; then
if which brew >/dev/null 2>&1 ; then
echo "==> Installing brew (brew update)..."
brew update
echo "==> Installing mongodb (brew install mongodb)..."
brew install mongodb
elif which port >/dev/null 2>&1 ; then
echo "==> Installing mongodb (port install mongodb)..."
port install mongodb
else
@davidsonfellipe
davidsonfellipe / gist:4529929
Last active December 11, 2015 02:19
install capistrano
# capistrano
if which cap &> /dev/null; then
echo "==> Checking capistrano... OK"
else
echo "==> Installing capistrano (gem install capistrano)..."
sudo gem install capistrano
echo "==> OK"
fi
@davidsonfellipe
davidsonfellipe / gist:4601852
Last active December 11, 2015 12:38
CSS FTW

#CSS FTW My way to face the challenge: Maintainable + Efficient + Optimized

##General

  • YSlow + Page Speed (Performance Rules)…
  • CSSLint Rules…
  • Don’t use too many web fonts talk to your designer, and explain the impact of loading many sources.

##Tools

$ workon default
$ brew install jpeg
$ pip install --upgrade --no-install PIL
$ vim $VIRTUAL_ENV/build/PIL/setup.py
-> JPEG_ROOT = '/usr/local/Cellar/jpeg/8d/'
-> FREETYPE_ROOT = libinclude('/usr/X11')
function load(url, callback) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = onReady;
function onReady() {
if(xhr.readyState < 4 || xhr.status !== 200) {
return;