Skip to content

Instantly share code, notes, and snippets.

View edo9k's full-sized avatar
🪲

Eduardo França edo9k

🪲
View GitHub Profile
@MarkusPfundstein
MarkusPfundstein / javascript.js
Last active November 6, 2019 00:01
pattern matching function using ramda
/*
* examples - code for matchC is below
* to test: copy&paste into http://ramdajs.com/repl
*/
function main() {
// its all good if all output lines have true in first tuple ;-)
const m1 = matchC('Hello')
.when('string', a => [true, a.toUpperCase()])
.when('number', a => [false, a])

PocketCHIP stuff

Utility

build in calculator: xcalc

use the built in browser: surf http://google.com (need help, man surf)

get a text browser: sudo apt-get install lynx

@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 22, 2024 07:37
Vanilla JavaScript Quick Reference / Cheatsheet
@drguildo
drguildo / TIS-100.md
Last active June 27, 2021 13:06
TIS-100 Cheat Sheet

TIS-100 Cheat Sheet

Instructions

Name Syntax Name Syntax
NOP NOP JMP JMP <LABEL>
MOV MOV <SRC>, <DST> JEZ JEZ <LABEL>
SWP SWP JNZ JNZ <LABEL>
SAV SAV JGZ JGZ
@kangax
kangax / quicksort.hs
Last active September 5, 2021 19:44
Haskell-inspired quick sort in ES6
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort (filter (<=x) xs)
biggerSorted = quicksort (filter (>x) xs)
in smallerSorted ++ [x] ++ biggerSorted
@danwagnerco
danwagnerco / vim_vundle_and_conemu.md
Created June 22, 2015 20:43
This is a Windows-specific walkthrough for installing Vim, Vundle and ConEmu

Vim, Vundle and ConEmu on Windows

Let's start by getting it out on the table: Sublime Text is great, and version 3 should no longer be considered "abandonware" as of build 3065. Sublime Text served me very, very well over the years. That said, trying out new things is a major part of leveling-up, and in that vein Vim deserves a go. (And have you seen some of those thoughtbot guys flying around in Vim? It's awesome!)

Getting Vim up-and-running on your Windows machine doesn't have to be an all-day project. In this post, we'll walk through:

  • Installing gVim, which gives us both the "classic" command line version as well as the graphical version
  • Installing Vundle, the best way to handle Vim-enhancing packages
  • Installing ConEmu, a supercharged command line emulator for Windows
@gglouser
gglouser / bfsmall.hs
Last active October 9, 2022 01:25
Moderately abominable brainfuck interpreter in Haskell.
import Control.Applicative
import Control.Monad.State
import Foreign
import System.Environment
import Text.Parsec as P
m=modify.flip advancePtr
r=get>>=lift.peek
w x=get>>=lift.flip poke x
a n=r>>=w.(+n)
c x=toEnum$fromEnum x
@phatak-dev
phatak-dev / README.md
Last active July 2, 2021 05:03
Functional Programming in C++

#Compilng You need g++ 4.9 to compile this code. Follow these steps to install g++-4.9

After installing run the following command to compile

/usr/bin/g++-4.9 -std=c++11 lambda.cpp

#Running

./a.out
defmodule Brainfuck do
# opcodes
@op_vinc "+" # increment value at memory address
@op_vdec "-" # decrement value at memory address
@op_pinc ">" # increment memory address
@op_pdec "<" # decrement memory address
@op_putc "." # output byte at memory address
@op_getc "," # input byte into memory address
@op_lbeg "[" # loop begin
@asyncanup
asyncanup / simple-javascript-assert.md
Last active May 11, 2022 01:03
Simple JavaScript assert

Why you need assertions

It's better to fail with your own error than undefined is not a function.

A simple assertion solution would let your application fail early and fail at the right point in runtime execution. Allowing you to handle it better.

How you write assertions