Skip to content

Instantly share code, notes, and snippets.

View jessecogollo's full-sized avatar
💭
#IamLibertarian

Jesse cogollo jessecogollo

💭
#IamLibertarian
View GitHub Profile
@jessecogollo
jessecogollo / deletreador.js
Created July 21, 2021 06:35
Ejercicio deletreador en JavaScript
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 July 21, 2021 06:32
Ejercicio deletreador en Haskell
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 July 21, 2021 06:32
Ejercicio ahorcado en JavaScript
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 July 21, 2021 06:32
Ejercicio ahorcado en Haskell
-- 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 ()
@jessecogollo
jessecogollo / speller.hs
Created June 28, 2021 04:59
speller exersise
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 June 20, 2021 02:59
guessing game - 2.11 - learnfuture
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 July 25, 2019 07:27
Codigo necesario para programar el arduino lilypad.
// 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 January 24, 2019 03:28
Propuesta nodeconf colombia

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…

'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 October 23, 2017 06:47
TextEncoder and TextDecoder
'use strict';
const {
TextEncoder,
TextDecoder
} = require('util');
let original = 'this is some data';
const encoder = new TextEncoder();
const uint8array = encoder.encode(original);