Skip to content

Instantly share code, notes, and snippets.

View tjweir's full-sized avatar

Tyler Weir tjweir

View GitHub Profile
@tjweir
tjweir / gist:098e8e45cc81bf506e37
Last active August 29, 2015 14:15
UNIX command syntax I often forget
# 1. Find by filename in the current directory hier
find . | grep filename.ext
#or
find . -name filename.ext
# 2. Specific find, getting rid of those files with .orig suffix
find . -name \*.orig | xargs rm -f '{}'
# 3. making sql command from a .csv
# pairs.csv has:

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
import java.io._
import java.nio.file.{Path, Files}
import org.specs2.io._
import org.specs2.Specification
import scalaz._, Scalaz._, stream._
import scalaz.stream.nio._
class ScalazStreamSpec extends Specification { def is = s2"""
prepare ${step(createFile)}
with io $ioProcess
@tjweir
tjweir / init-addition.el
Created December 2, 2014 14:40
emacs timeclocking
;; Added this to my init.el today
(global-set-key [(f7)] 'timeclock-in)
(global-set-key [(control f7)] 'timeclock-out)
@tjweir
tjweir / introrx.md
Last active August 29, 2015 14:08 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@tjweir
tjweir / fav1.erl
Last active December 13, 2023 12:27
Universal server from Joe Armstrong, can I make it turn back into a universal server after?
-module(fav1).
-export([test/0]).
test() ->
Pid = spawn(fun universal_server/0),
Pid ! {become, fun fac_server/0},
Pid ! {self(), 50},
receive
Y -> Y
end,
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]
@tjweir
tjweir / gist:3f326170e0632d3bb76d
Created July 18, 2014 12:58
My imenu config for scala.
;; M-x package-install imenu-anywhere
(add-hook 'scala-mode-hook
(lambda ()
(setq imenu-generic-expression
'(
("var" "\\(var +\\)\\([^(): ]+\\)" 2)
("val" "\\(val +\\)\\([^(): ]+\\)" 2)
("override def" "^[ \\t]*\\(override\\) +\\(def +\\)\\([^(): ]+\\)" 3)
("private def" "^[ \\t]*\\(private\\(\\[.*?\\]+\\)*\\) +\\(def +\\)\\([^(): ]+\\)" 4)
@tjweir
tjweir / papers_to_read
Last active August 29, 2015 14:02
Papers to read during hospital stay
* "Your Server as a Function" - http://monkey.org/~marius/funsrv.pdf
* "Monoids: Theme and Variation" - http://www.cis.upenn.edu/~byorgey/pub/monoid-pearl.pdf
* "Union, Intersection, and Refinement Types and Reasoning About Type Disjointness for Secure Protocol Implementations" - http://prosecco.gforge.inria.fr/personal/hritcu/publications/rcf-and-or-coq-jcs-submission.pdf
* "Haskell Session Types with (Almost) No Class" - http://www.eecs.harvard.edu/~tov/pubs/haskell-session-types/
* "WHY DO COMPUTERS STOP AND WHAT CAN BE DONE ABOUT IT?" - http://citeseer.ist.psu.edu/viewdoc/download;jsessionid=285F73A4236CA1AE99EAB2439FFFB266?doi=10.1.1.59.6561&rep=rep1&type=pdf
module GroupBy where
import Data.Map (Map)
import qualified Data.Map as Map
groupBy :: Ord b => (a -> b) -> [a] -> Map b [a]
groupBy f = foldr (\ v -> Map.insertWith (++) (f v) [v]) Map.empty
groupBy' :: Ord b => (a -> b) -> [a] -> Map b [a]