Skip to content

Instantly share code, notes, and snippets.

View tjweir's full-sized avatar

Tyler Weir tjweir

View GitHub Profile
@dysinger
dysinger / easy-ubuntu-openvpn.sh
Created August 28, 2013 18:22
Create a VPN on EC2 in 30 seconds
#!/bin/sh
# linux firewall/forwarding
modprobe iptable_nat
echo 1 | tee /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.10.10.1/2 -o eth0 -j MASQUERADE
# install openvpn
apt-get update && apt-get install -y openvpn
cd /etc/openvpn/
INSTANCE=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
openvpn --genkey --secret ${INSTANCE}.key
@eltimn
eltimn / Build.scala
Last active December 22, 2015 12:49
SBT build with deploy.
import sbt._
import sbt.Keys._
object MyBuild extends Build {
import Dependencies._
import BuildSettings._
lazy val main = Project("root", file("."))
.settings(mainWebSettings: _*)
.settings(
@milessabin
milessabin / gist:7136706
Last active December 26, 2015 10:29
My crib sheet from the shapeless workshop @ Scala IO.
package scalaio
import shapeless._, poly._
object list extends (Id ~> List) {
def apply[T](t : T) = List(t)
}
object headOption extends (List ~> Option) {
def apply[T](l : List[T]) = l.headOption
@dysinger
dysinger / gist:8760823
Created February 1, 2014 23:40
Idris -> Java Hello World in 6 lines
$ cabal sandbox init
$ cabal install idris
$ echo 'main : IO () ; main = print "hello"' >hello.idr
$ ./.cabal-sandbox/bin/idris --mvn --codegen Java -o hello hello.idr
$ cd hello
$ mvn -DmainClass=hello package shade:shade
$ java -jar target/hello.jar
"hello"
@runarorama
runarorama / gist:a8fab38e473fafa0921d
Last active April 13, 2021 22:28
Compositional application architecture with reasonably priced monads
sealed trait Interact[A]
case class Ask(prompt: String)
extends Interact[String]
case class Tell(msg: String)
extends Interact[Unit]
trait Monad[M[_]] {
def pure[A](a: A): M[A]
@evancz
evancz / Haskell-Style-Guide.md
Last active March 23, 2023 15:27
A style guide for Elm tools

Haskell Style Guide for Elm

Goal: a consistent style throughout all Elm projects that is easy to read and produces clean diffs to make debugging easier. This means valuing regularity and simplicity over cleverness.

Line Length

Keep it under 80 characters. Going over is not the end of the world, but consider refactoring before you decide a line really must be longer.

Variables

@jiaaro
jiaaro / hotkey_helpers.js
Last active December 11, 2024 17:51
Mac Automation – Javascript (JSX) Hotkey helpers
// How to use:
// 1. Open "Script Editor" (requires OS X 10.10 Yosemite)
// 2. Change the language from "AppleScript" to "JavaScript"
// 3. Paste the code below and replace the safari example.
//
// More info:
// https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html
var sys_events = Application("System Events");
@cqfd
cqfd / echoz.scala
Created February 3, 2015 15:11
scalaz-stream echo server
import java.net.InetSocketAddress
import scala.concurrent.Task
import scalaz.stream._
object Main {
def main(args: Array[String]): Unit = {
val address = new InetSocketAddress(45678)
implicit val cg = nio.DefaultAsynchronousChannelGroup
val s: Process[Task, Process[Task, Unit]] = nio.server(address).map { client =>
client.flatMap { ex =>

I'm putting this list together as a sort of reading plan for myself in order to learn more about general cluster scheduling/utilization and various ways of generically programming to them. Lists of direct links to PDFs here in the order I think makes some sense from skimming reference sections.

Happy to here of any additions that might be sensible.

The Basics

  1. Google File System since everything references it and data locality is a thing.
  2. Google MapReduce because it's one of the earlier well-known functional approaches to programming against a cluster.
  3. Dryad for a more general (iterative?) programming model.
  4. Quincy for a different take on scheduling.
  5. [Delay Scheduling](h
{-# language KindSignatures #-}
{-# language PolyKinds #-}
{-# language DataKinds #-}
{-# language TypeFamilies #-}
{-# language RankNTypes #-}
{-# language NoImplicitPrelude #-}
{-# language FlexibleContexts #-}
{-# language MultiParamTypeClasses #-}
{-# language GADTs #-}
{-# language ConstraintKinds #-}