Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
#IamLibertarian

Jesse cogollo jessecogollo

💭
#IamLibertarian
View GitHub Profile
@jessecogollo
jessecogollo / deletreador.js
Created Jul 21, 2021
Ejercicio deletreador en JavaScript
View deletreador.js
const getLetter = (word) => {
return word[0]
}
const createSinglePhrase = (word) => {
return `${getLetter(word)} is for ${word}`
}
const createPhrase = (word, lst) => {
return lst.length === 1 ?
@jessecogollo
jessecogollo / deletreador.hs
Created Jul 21, 2021
Ejercicio deletreador en Haskell
View deletreador.hs
getLetter :: [Char] -> [Char]
getLetter word =
take 1 word
createSinglePhrase :: [Char] -> [Char]
createSinglePhrase word =
getLetter word ++ " is for " ++ word
createPhrase :: [Char] -> [[Char]] -> [Char]
createPhrase word lst =
@jessecogollo
jessecogollo / ahorcado.js
Last active Jul 21, 2021
Ejercicio ahorcado en JavaScript
View ahorcado.js
const readline = require('readline')
const R = require('ramda')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
})
const question = (question) => {
return new Promise(function (resolve) {
@jessecogollo
jessecogollo / ahorcado.hs
Last active Jul 21, 2021
Ejercicio ahorcado en Haskell
View ahorcado.hs
-- import Data.Char
import System.Random
check :: String -> String -> Char -> (Bool, String)
check word display c
= (c `elem` word, [if x == c
then c
else y | (x,y) <- zip word display])
turn :: String -> String -> Int -> IO ()
View speller.hs
getLetter :: [Char] -> [Char]
getLetter word =
take 1 word
createSinglePhrase :: [Char] -> [Char]
createSinglePhrase word =
getLetter word ++ " is for " ++ word
createPhrase :: [Char] -> [[Char]] -> [Char]
createPhrase word lst =
@jessecogollo
jessecogollo / starman.hs
Last active Jun 20, 2021
guessing game - 2.11 - learnfuture
View starman.hs
import System.Random
check :: String -> String -> Char -> (Bool, String)
check word display c
= (c `elem` word, [if x == c
then c
else y | (x,y) <- zip word display])
turn :: String -> String -> Int -> IO ()
turn word display n =
@jessecogollo
jessecogollo / avakids.cpp
Created Jul 25, 2019
Codigo necesario para programar el arduino lilypad.
View avakids.cpp
// Avakids by @avanet
/******************************************************************
--LilyPad Light Sensor Trigger - Automatic Night Light
--By KOOKYE
This example code reads the input from a LilyPad Light Sensor compares it to
a set threshold named 'dark'. If the light reading is below the threshold,
three LEDs will turn on and a tri-color led will change the color.
Light Sensor connections:
@jessecogollo
jessecogollo / cfpNodeJSConfColombia.md
Created Jan 24, 2019
Propuesta nodeconf colombia
View cfpNodeJSConfColombia.md

NOW for nodeJS developers

desde que empecé a programar, me ha dado miedo la nube… por los problemas que pueden salir en producción y por los precios (la nube no es barata)… Sin embargo, desde que salio NOW by zeit ese miedo desaparecio ya que puedo jugar en la nube a un costo cero y sin miedo a embarrarla.

En esta lightning talk, les compartire un poco las caracteristicas de NOW, y lo simple que es desplegar en la nube. Como desplegar a producción con un simple git push, o con un simple now en nuestra terminal.

En conclusión, quiero mostrar los beneficios de tener una granja de servidores en la nube sin tener servidores…

View index.mjs
'use strict';
// node --experimental-modules index.mjs
import fs from 'fs';
import util from 'util';
const readFile = util.promisify(fs.readFile);
const fnThen = (result) => {
@jessecogollo
jessecogollo / encoder-decoder.js
Created Oct 23, 2017
TextEncoder and TextDecoder
View encoder-decoder.js
'use strict';
const {
TextEncoder,
TextDecoder
} = require('util');
let original = 'this is some data';
const encoder = new TextEncoder();
const uint8array = encoder.encode(original);