This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//in the parent: | |
window.addEventListener("message", function(m){console.log(m);}) | |
//in the iframe: | |
window.parent.postMessage("hola", "*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# exec an external python script (http://www.blender.org/api/blender_python_api_2_59_2/info_tips_and_tricks.html) | |
filename = "/full/path/to/myscript.py" | |
exec(compile(open(filename).read(), filename, 'exec')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up initial code for visualization | |
var svg = d3.select(controller.element).append("svg") | |
.attr("width", "100%").attr("height", "100%") | |
.append("g") | |
.attr("transform", "translate(10,10)"); | |
// This function receives a JS Array of JS Objects | |
// representing the current state of your data. | |
controller.update = function (data) { | |
// Join new data with old elements, if any. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//download a whole youtube playlist as mp3 files: | |
youtube-dl -ix -k --audio-format mp3 YOUTUBE_PLAYLIST_URL | |
GREP | |
simple use of grep: | |
grep -n search_string files //ej: grep -n main *.cpp | |
//list files that contains some string (only .c and .h in this example) -w forces exact word match. | |
grep --include=\*.{c,h} -rnw './' -e "your_search_string" | |
#concatenate two mp3 files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctrl+space open the command list | |
to enable vim mode: see this readme https://github.com/LightTable/Vim#setup | |
ctrl+space show user behaviors add this line: | |
[:editor :lt.objs.editor/line-numbers] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----- | |
this one will save your life, if by mistake you delete both the remote and local branch: | |
git log -g | |
http://stackoverflow.com/questions/19592275/git-recover-branch-deleted-on-remote-and-local-folder-deleted | |
//----- | |
git checkout phase_3_main //pasarse a la rama de desarrollo activa | |
git up //verificar que estemos en esa rama |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var A = function(){ | |
console.log("constructor A"); | |
//create an attribute | |
this.a0 = "a0"; | |
} | |
//adding another attribute | |
A.prototype.a1 = "a1"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:set number #enable line numbering | |
:set tabstop=2 #set tab size | |
:set nowrap #disable wrapping | |
#use vi mode in the shell | |
set -o vi #for bash | |
bindkey -v #for zshell |