Skip to content

Instantly share code, notes, and snippets.

View nobitagit's full-sized avatar
🕸️
The less I know the better

Aurelio nobitagit

🕸️
The less I know the better
View GitHub Profile
@nobitagit
nobitagit / GIF-Screencast-OSX.md
Created January 31, 2016 00:41 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@nobitagit
nobitagit / introrx.md
Created February 5, 2016 15:27 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@nobitagit
nobitagit / reverse-recursive-tree.js
Last active November 14, 2023 13:16
Build a reverse recursive tree in JavaScript
/**
* from this..
**/
const list = [
{id: 0 , parent: null},
{id: 1 , parent: 0},
{id: 2 , parent: 1},
{id: 3 , parent: 1},
{id: 4 , parent: 2},
{id: 5 , parent: 1},
@nobitagit
nobitagit / python3venv.sh
Last active June 7, 2017 05:01
virtualenv with local python version
# create a venv wiht python 3
# which python3
virtualenv -p /usr/local/bin/python3 yourenv

Find command by name:

  1. SHIFT+CMD+a

Search anywhere:

  1. SHIFT+SHIFT

GIT blame:

# to grep for commmits, apart from the usual "| grep" you can:
git log --grep=some --grep=key_word --since=1.month
# more here: http://gitster.livejournal.com/30195.html
# after checking out a previous revision on git log, you can come back to the previous HEAD by doing
git ckeckout -
// Returns undefined for non existent props
// taken from http://stackoverflow.com/questions/18891939/javascript-retrieve-object-property-path/18892019#18892019
function getKey(key, obj) {
return key.split('.').reduce(function(a,b){
return a && a[b];
}, obj);
}
getKey('foo.bar', obj); //=> "I want this"
getKey('foo.baz', obj); //=> undefined
@nobitagit
nobitagit / vim_shortcuts.sh
Last active July 18, 2016 07:20
Vim shorcuts
# Move to end of line and enter EDIT mode
A
# Move to beginning of line and enter EDIT mode
I
# Move to end of file
G
# combine commands to get to end of last line and enter EDIT mode
GA
# Move to beginning of file
1G or gg
@nobitagit
nobitagit / .vimrc
Created June 19, 2016 11:33
My vimrc
" A minimal vimrc for new vim users to start with.
" Referenced here: http://vimuniversity.com/samples/your-first-vimrc-should-be-nearly-empty
" If you don't understand a setting in here, just type ':h setting'.
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Make backspace behave in a sane manner.
set backspace=indent,eol,start
/**
* Lessons learned implementing a simple adder.
* Array functions do not have the arguments object
**/
var add = function() {
var args = Array.prototype.slice.call(arguments)
return args.reduce((all, item) => {
return all + item;
}, 0);