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
#aliases | |
alias ..="cd .." | |
alias l="ls -al" | |
#Found in http://clippy.in/b/YJLM9W | |
alias server="python -m SimpleHTTPServer" | |
alias myip="wget http://automation.whatismyip.com/n09230945.asp -O - -q ; echo" | |
PATH=/usr/local/bin:$PATH | |
export PATH |
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
~/.ssh/config | |
Host <nombre que le quieras poner al vm> | |
user <user del vm> | |
HostName <ip del vm> | |
ForwardAgent yes | |
en tu cmd-line corres `ssh <nombre que le pusiste al vm>` |
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 cacheStatusValues = []; | |
cacheStatusValues[0] = 'uncached'; | |
cacheStatusValues[1] = 'idle'; | |
cacheStatusValues[2] = 'checking'; | |
cacheStatusValues[3] = 'downloading'; | |
cacheStatusValues[4] = 'updateready'; | |
cacheStatusValues[5] = 'obsolete'; | |
var cache = window.applicationCache; | |
cache.addEventListener('cached', logEvent, false); |
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
# Damerau–Levenshtein distance (Wikipedia) implementation | |
# Found in http://stackoverflow.com/questions/11919065/sort-an-array-by-the-levenshtein-distance-with-best-performance-in-javascript | |
# Answer by user http://stackoverflow.com/users/305319/james-westgate | |
levDist = (s, t) -> | |
d = [] #2d matrix | |
# Step 1 | |
n = s.length | |
m = t.length |
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
%html | |
%head | |
%title= 'iCal to CSV converter' | |
%script(type='text/javascript' src='https://rawgit.com/mozilla-comm/ical.js/master/build/ical.js') | |
:javascript | |
// Adapted from http://www.html5rocks.com/en/tutorials/file/dndfiles/ | |
function handleFileSelect(evt) { | |
var reader = new FileReader(); | |
reader.onload = function (e) { | |
var comp = new ICAL.Component(ICAL.parse(e.target.result)[1]); // result == ['icalendar', data] |
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
/* | |
Copyright (c) 2010 Aza Raskin | |
http://azarask.in | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the |
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
function remind { | |
echo Example: remind \"Go to grocery store\" 12/15/2013 10:00:00PM | |
osascript - "$1" "$2" "$3" <<END | |
on run argv | |
set stringedAll to date (item 2 of argv & " " & item 3 of argv) | |
tell application "Reminders" | |
make new reminder with properties {name:item 1 of argv, due date:stringedAll } | |
end tell | |
end run | |
END |
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
function sizeInMB(string) { | |
return (string.length * 2) / (1024 * 1024); | |
} | |
function addKeySizeToTotal(runningTotal, key) { | |
// Used as Array.reduce callback | |
return sizeInMB(localStorage[key]) + runningTotal; | |
} | |
function logLocalStorageKeySize(key) { |
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
import Html exposing (..) | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (onInput, onClick) | |
import Char exposing (..) | |
import Tuple exposing (first, second) | |
main = | |
Html.beginnerProgram | |
{ model = model | |
, view = view |
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
INSERT INTO `vista_corregimientos`(`id_provincia`, `provincia`, `id_distrito`, `distrito`, `ref_province`, `id_corregimiento`, `corregimiento`, `ref_distrito`) VALUES (1, 'Bocas del Toro', 1, 'Almirante', 1, 1, 'Puerto Almirante', 1); | |
INSERT INTO `vista_corregimientos`(`id_provincia`, `provincia`, `id_distrito`, `distrito`, `ref_province`, `id_corregimiento`, `corregimiento`, `ref_distrito`) VALUES (1, 'Bocas del Toro', 1, 'Almirante', 1, 2, 'Barriada Guaymí', 1); | |
INSERT INTO `vista_corregimientos`(`id_provincia`, `provincia`, `id_distrito`, `distrito`, `ref_province`, `id_corregimiento`, `corregimiento`, `ref_distrito`) VALUES (1, 'Bocas del Toro', 1, 'Almirante', 1, 3, 'Barrio Francés', 1); | |
INSERT INTO `vista_corregimientos`(`id_provincia`, `provincia`, `id_distrito`, `distrito`, `ref_province`, `id_corregimiento`, `corregimiento`, `ref_distrito`) VALUES (1, 'Bocas del Toro', 1, 'Almirante', 1, 4, 'Nance de Riscó', 1); | |
INSERT INTO `vista_corregimientos`(`id_provincia`, `provincia`, `id_distrito`, `distrito` |
OlderNewer