Skip to content

Instantly share code, notes, and snippets.

var Autobot = function(nombre){
this.nombre = nombre;
this.timer = +new Date();
};
Autobot.prototype.saludar = function() {
alert('Hola, me llamo '+ this.nombre + '\nTime: ' + (+new Date() - this.timer) + 'ms' );
};
Autobot.prototype.saludoDelay = function(ms){

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@boton
boton / Change Font.sketchplugin
Last active January 3, 2016 11:59 — forked from bomberstudios/Change Font.sketchplugin
Change font family for all text layers in Sketch
// Change font (ctrl a)
var font_name,
select_one_textlayer = false;
function check_layer(layer){
log("Checking layer " + layer + " of klass: " + [layer class])
switch ([layer class]) {
case MSTextLayer:
log("Found text layer!")
layer.setFontPostscriptName(font_name);
const uniq = arrArg => arrArg.filter((elem, index, arr) => arr.indexOf(elem) === index);
git archive -o latest.zip HEAD
/***
<button> reset
1. Remove default browser appearance for buttons.
2. Remove margins.
3. Remove borders for IE.
4. Normalize font and color not inherited by `button`.
5. Address `overflow` in IE
6. Normalize cursor style
7. Normalize line-height
8. Normalize text-align
@boton
boton / parse_dotenv.bash
Created April 4, 2018 00:00 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@boton
boton / git-fs-history
Created May 8, 2018 08:07 — forked from jackocnr/git-fs-history
Git filesize history (shell script)
#!/bin/sh
#
# list the given file's filesize next to each commit
# usage: git-fs-history path/to/file
#
if [ $# -ne 1 ]; then
echo "Error: invalid number of arguments."
exit 1
@boton
boton / encoding-video.md
Created May 16, 2018 09:40 — forked from glen-cheney/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@boton
boton / flattenArray.js
Created May 29, 2018 16:48
Array flatten
// borrowed from https://gist.github.com/Integralist/749153aa53fea7168e7e#gistcomment-1457123
const flatten = list => list.reduce(
(accumulator, element) => accumulator.concat(Array.isArray(element)
? flatten(element)
: element),
[]
);