Instantly share code, notes, and snippets.

View import_and_extend.exs
defmodule Father do
def sing() do
IO.puts "Lalalalalala"
def song(a, b) do
IO.puts "Lelelelelele #{a} #{b}"
View pir.ino
int ledPin = 13;
int pirPin = 2;
int default_remaining = 30;
int remaining = 0;
int val = 0;
void setup() {
pinMode(ledPin, OUTPUT);
# Loan Env Variables
while read line; do
export $(echo $line | sed 's/"//g')
done < /etc/environment
View numbers_in_lambda_calculus.lisp
;; Church Numbers
(setq zero (lambda (f) (lambda (x) x)))
(setq one (lambda (f) (lambda (x) (funcall f x))))
(setq two (lambda (f) (lambda (x) (funcall f (funcall f x)))))
;; Manual Calc
(funcall (funcall zero (lambda (x) (+ 1 x))) 0)
(funcall (funcall one (lambda (x) (+ 1 x))) 0)
(funcall (funcall two (lambda (x) (+ 1 x))) 0)
View Dockerfile
# How to Use
# open -a XQuartz
# socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
# docker build . -t ds-xclock
# docker run -e DISPLAY=YOUR_LOCAL_IP_HERE:0 -it ds-xclock
# Useful Links:
View class_definition_in_specs.rb
require 'spec_helper'
describe "Wow Coins" do
let(:klasz_class) do do
attr_reader :title
def initialize(properties)
@title = properties[:title]
View ssh_config
Host *
User someuser
ForwardAgent yes
LocalForward localhost:43306 localhost:3306
LocalForward localhost:49200 localhost:9200
LocalForward localhost:49001 localhost:9001
View lambda_calculus.rb
# Rules: A lamda always has 1 parameter, nothing more, nothing less
# Useful Content:
# Identity lambda
IDENTITY = ->x { x }
# True, returns the first argument
TT = ->x { ->y { x } }
# False, returns the last argument
View class_variable_example.rb
# Ruby Class Variable Examples without @@
class Foo
puts 'Hey! I\'m talking'
class Bar
View count_words_loop.clj
(defn split-words
(clojure.string/split phrase #"\s"))
(defn count-words
[phrase word]
(let [words (split-words (clojure.string/lower-case phrase))
lower-case-word (clojure.string/lower-case word)]
(loop [head (first words)
tail (rest words)