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
/* | |
* 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]) |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
Working with DOM | Working with JS | Working With Functions |
---|---|---|
Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
Create DOM Elements | Conditionals |
quicksort :: (Ord a) => [a] -> [a] | |
quicksort [] = [] | |
quicksort (x:xs) = | |
let smallerSorted = quicksort (filter (<=x) xs) | |
biggerSorted = quicksort (filter (>x) xs) | |
in smallerSorted ++ [x] ++ biggerSorted |
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:
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 |
#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 |