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
import shapeless._ | |
import java.sql.PreparedStatement | |
trait ToRow[A]{ | |
def toRow(a: A, statement: PreparedStatement): (Int) => Unit | |
} | |
implicit val stringToRow: ToRow[String] = new ToRow[String]{ | |
def toRow(s: String, statement: PreparedStatement) = statement.setString(_,s) | |
} |
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
import Control.Monad.Trans.Reader | |
import Control.Monad.Trans.Maybe | |
import Control.Monad.IO.Class | |
import Control.Monad.Trans | |
--import Control.Monad.State | |
m :: IO () | |
m = do | |
runReaderT r2 5 |
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
sudo apt-get install bind9 bind9utils bind9-doc | |
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip | |
/etc/bind/named.conf.options: | |
options { | |
directory "/var/cache/bind"; | |
recursion yes; | |
allow-query { localhost; }; | |
forwarders { |
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 'package) | |
(setq package-list '(markdown-mode | |
yaml-mode | |
js2-mode | |
jsx-mode | |
find-file-in-project | |
auto-complete | |
nix-mode | |
dockerfile-mode | |
scala-mode2 |
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
sudo apt-get install cups | |
sudo apt-get install hplip-gui | |
sudo usermod -a -G lpadmin pi | |
sudo emacs /etc/cups/cupsd.conf | |
# change: | |
#Listen section to: | |
Listen 632 | |
#Add to all top level Location sections until Policy turns up in the file: | |
Allow @local |
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
# Assumes eth0 is WAN and eth1 is the port you want to act as a router for other devices. | |
sudo apt-get install openvpn | |
sudo apt-get install dnsmasq | |
/etc/network/interfaces - add: | |
#USB NIC serving as internal gateway | |
iface eth1 inet static | |
address 192.168.10.1 | |
netmask 255.255.255.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
var Router = function(routeDef){ | |
this.routes = []; | |
routeDef.call(this); | |
}; | |
Router.prototype.splitPath = function(path){ | |
var splits = path.split('/'); | |
return _.filter(splits, function(part){ | |
return part !== ''; |
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 'package) | |
(setq package-list '(markdown-mode | |
yaml-mode | |
js2-mode | |
jsx-mode | |
find-file-in-project | |
auto-complete | |
ghc | |
nix-mode | |
dockerfile-mode |
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
cabal2nix --sha256=0 cabal-file.cabal > shell.nix | |
#add the following to the top line | |
haskellPackages ? (import <nixpkgs> {}).haskellPackages, | |
# remove sha line, add src location | |
src = ./src; | |
# add required build-tools to mkDerivation section, happy, alex & ghc-mod used for emacs | |
buildTools = [ haskellPackages.cabal-install haskellPackages.happy haskellPackages.alex haskellPackages.hlint]; # haskellPackages.ghc-mod - ghc-mod broken right now |
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
function getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
var webrtc = new SimpleWebRTC({ | |
// the id/element dom element that will hold "our" video | |
localVideoEl: 'localVideo', |