Skip to content

Instantly share code, notes, and snippets.

View gabeno's full-sized avatar
🎯
Focusing

Gabriel Majivu gabeno

🎯
Focusing
View GitHub Profile
@gabeno
gabeno / list_timing_results
Created July 24, 2015 11:28
List Timing Results
# tests done on an ubuntu vm
concat 1.65812611580 milliseconds
append 0.07023715973 milliseconds
list comprehension 0.03012800217 milliseconds
list range 0.00904202461 milliseconds
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@gabeno
gabeno / gdal
Created May 10, 2014 11:47
Install GDAL
$ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
$ sudo apt-get update
$ sudo apt-get install gdal-bin
@gabeno
gabeno / class-objects-js
Created April 15, 2014 15:15
overview on classes and objects in JS
// the original Animal class and sayName method
function Animal(name, numLegs) {
this.name = name;
this.numLegs = numLegs;
}
Animal.prototype.sayName = function() {
console.log("Hi my name is " + this.name);
};
@gabeno
gabeno / remember.md
Last active August 29, 2015 13:57
Stuff I usually forget

Setting up virtualenv and activating it

$ virtualenv venv --distribute
New python executable in venv/bin/python
Installing distribute.........done.
Installing pip................done.
$ source venv/bin/activate
(venv)$ python
@gabeno
gabeno / assignment operator
Created March 8, 2014 14:50
Deduce meaning of assignment operator |=
a = new Array();
for (var b = 0; b < 10; b++) {
a[0] |= b; // <= ?
}
@gabeno
gabeno / backbone-events
Created February 13, 2014 11:01
remove callback bug in backbone?
'use strict';
var chai = require('chai'),
expect = chai.expect,
sinon = require('sinon'),
sinonChai = require('sinon-chai');
var Backbone = require('backbone');
var _ = require('lodash/dist/lodash.underscore');