Skip to content

Instantly share code, notes, and snippets.

View fpinzn's full-sized avatar

Francisco Pinzón fpinzn

  • Bogotá, Colombia
View GitHub Profile
@fpinzn
fpinzn / gist:5530241
Created May 7, 2013 04:22
Create directory ruby and navigate to it.
mkdir ruby && cd $_
@fpinzn
fpinzn / cube.sh
Last active August 29, 2015 13:57
#!/bin/bash
set -e
source /build/buildconfig
set -x
apt-get install -y mongodb mongodb-server
npm install cube
@fpinzn
fpinzn / generalize_me.sh
Created March 17, 2014 18:41
json to cson using js2coffee
js2coffee -it fn_tree.json > fn_tree.cson
@fpinzn
fpinzn / gist:9799658
Created March 27, 2014 03:40
take screenshot using protractor
browser.driver.takeScreenshot().then (data)->
screenShotDirectory = "../"
filename = "ss.png"
stream = fs.createWriteStream(screenShotDirectory + filename)
stream.write new Buffer(data, "base64")
stream.end()
@fpinzn
fpinzn / dashboardsillo
Last active December 30, 2015 15:47
The most basic console dashboard
brew install watch
watch -n 1 echo 'Perniles en `date "+%S"` minutos.'
#!/bin/bash
set -eo pipefail
# This should be a cd to a env var with the root of the notes directory
nhome=~/versioned/Notes/nValt
file=".note.searching.$RANDOM"
#Search the files contents
pushd $nhome
ag "$@" > $nhome/$file
#Search the file names
ls | ag "$@" >> $nhome/$file
#!/bin/sh
# Displays the received arguments as options and returns the option selected
# Set the prompt for the select command
PS3="Type a number or 'q' to quit: "
# Show a menu and ask for input. If the user entered a valid choice return it.
select option in "$@"; do
if [ -n "$option" ]; then
echo ${option}
{head, group-by, lines, take-while} = require 'prelude-ls'
fs = require 'fs'
#aliases
CL = console.log
#returns the lines in the N level of indentation
# Usage: indentificator file [level]
# If no level is provided all levels will be printed
# TODO: receive char-value (tab-space equivalency)as an arg of the program
char-value = {'\t': 1, ' ': 0.5}
@fpinzn
fpinzn / Currency formatter angular.js directive
Created February 17, 2015 02:46
currency directive to prepend a $ signto the value and add . every three digits. The model value stays without these ornaments.
module.directive('currency', function () {
return {
require: 'ngModel',
link: function(elem, $scope, attrs, ngModel){
$scope.addPoints = function(val){
console.log("formater points", val);
var count = 0, result;
return _.reduceRight(val, function(memo, item){
@fpinzn
fpinzn / color-conventions
Created March 13, 2015 01:02
Colors to Maximize salience on a white background
#F8D757
#311F55
#ED4E1A
#98E1E3
#EA2B12
#FAEB95
#6BC35F
#EFA7BA
#2872BB
#F5C79B