This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"$id": "child.json", | |
"type": "integer" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
module Stuff where | |
import Data.Aeson | |
import Data.ByteString.Lazy.Char8 as BC | |
data FooBar = Foo | Bar deriving (Eq, Show) | |
instance ToJSON FooBar where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- In a hypothetical scenario where: | |
-- * I have packs of beverages | |
-- * Each pack belongs to a Brand (Coke or Pepsi) and contains a Product | |
-- * Each product belongs to a Brand (Coke or Pepsi) | |
-- * A Coke pack filled with Coke cans is correct | |
-- * A Coke pack filled with Pepsi cans is incorrect | |
-- | |
-- Is there a way that I can make the type system check that for me during compilation time? | |
-- I know I could have smart constructors that would build the correct pack with the correct content but I'd like to know if there are other and smarter -- ways of achieving it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Father do | |
def sing() do | |
IO.puts "Lalalalalala" | |
end | |
def song(a, b) do | |
turn_bass_on() | |
IO.puts "Lelelelelele #{a} #{b}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-hc-sr501-motion-sensor-tutorial/ | |
int ledPin = 13; | |
int pirPin = 2; | |
int default_remaining = 30; | |
int remaining = 0; | |
int val = 0; | |
void setup() { | |
pinMode(ledPin, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Loan Env Variables | |
while read line; do | |
export $(echo $line | sed 's/"//g') | |
done < /etc/environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: | |
# https://github.com/moby/moby/issues/8710 | |
# http://kartoza.com/en/blog/how-to-run-a-linux-gui-application-on-osx-using-docker/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Wow Coins" do | |
let(:klasz_class) do | |
Class.new do | |
attr_reader :title | |
def initialize(properties) | |
@title = properties[:title] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host *.staging.something.com | |
User someuser | |
ForwardAgent yes | |
LocalForward localhost:43306 localhost:3306 | |
LocalForward localhost:49200 localhost:9200 | |
LocalForward localhost:49001 localhost:9001 |
NewerOlder