Skip to content

Instantly share code, notes, and snippets.

View cabe56's full-sized avatar

Jose Varela cabe56

  • Cuanto
  • Panama City, Panama
View GitHub Profile
@cabe56
cabe56 / Notion.ts
Created May 23, 2021 20:34
Notion's block type
// https://www.notion.so/blog/data-model-behind-notion
enum BlockType {
Heading,
Callout,
Toggle,
Text,
Image,
OrderedList,
TodoList,
@cabe56
cabe56 / introrx.md
Created April 27, 2021 05:06 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@cabe56
cabe56 / adams-heroku-values.md
Last active December 14, 2020 01:15 — forked from adamwiggins/adams-heroku-values.md
My Heroku values

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Throw things away

@cabe56
cabe56 / vista_corregimientos_20170925.sql
Created September 25, 2017 16:39
Listado de corregimientos por provincia gracias a Mario Rios de Trisfera
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`
@cabe56
cabe56 / 03-form.elm
Created September 17, 2017 06:46
An Introduction to Elm - Form
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
@cabe56
cabe56 / local_storage_size.js
Last active August 29, 2015 14:25 — forked from diegocasmo/local_storage_size.js
Calculates localStorage key and total size occupied by data in MB
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) {
@cabe56
cabe56 / remind_me.sh
Created May 19, 2015 16:10
Create OSX reminder from cmd line
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
/*
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
@cabe56
cabe56 / iOS-reminders-export-explorer.haml
Created May 24, 2014 02:36
Parse .ics file exported from iOS Reminders
%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]
@cabe56
cabe56 / levDist.coffee
Created May 9, 2014 23:30
Damerau–Levenshtein distance implementation
# 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