Skip to content

Instantly share code, notes, and snippets.

(defn topo-sort
"Provided a map of values to their dependencies, returns a seq of the values
sorted topologically.
Adapted from code by cgrande at:
https://groups.google.com/forum/#!topic/clojure/-sypb2Djhio"
[deps]
(mapcat #(for [[u vs] %
:when (empty? vs)]
u)
(take-while seq
@rbranson
rbranson / gist:03d88e3733c6ee098a89
Last active July 25, 2017 15:17
My Thoughts on Rust

Rust is the first language that has emerged in the past few years that solves enough of my problems that it would be worth not only learning & teaching an entirely new language, but also sacrificing the maturity of the language ecosystems I’ve become accustomed to.

I highly suggest you read the "Guide" provided by the language developers or this won't make much sense. These are just some of my thoughts and are intended to highlight particular things that stand out to me. I am just a practitioner and not an expert in any of these languages, so I have probably made some incorrect assumptions and out-of-date assertions. Bare with me.

Rust feels like the first time momentum has gained behind a true systems programming language that uses modern PL design techniques to prevent common errors when dealing with memory. It seems like others have previously either been too anemic to be worth adopting or too abstract to provide proper control. The type system and assignment semantics are designed specifically to preven

@jeffyip
jeffyip / rails_json_cookie_session_store.rb
Last active September 23, 2020 07:03
Monkey Patch Ruby on Rails' cookie based session store to use JSON as its serializer instead of Marshal
@ieure
ieure / gist:1334458
Created November 2, 2011 18:35
scala-defuns.el
(defun scala-beginning-of-defun (&optional arg)
(re-search-backward "\\(\\(case\\s*\\)?class\\|def\\)" nil t arg))
(defun scala-end-of-defun (&optional arg)
(scala-beginning-of-defun)
(goto-char (- (search-forward "{") 1))
(forward-sexp))
(eval-after-load "scala-mode"
(add-hook 'scala-mode-hook
@dehora
dehora / build-scribe-2.2.tar.gz.rst
Created July 7, 2011 20:17
build-scribe-2.2.tar.gz

Did this to build scribe-2.2.tar.gz

Get thrift 0.5.0 instead of 0.6.1/0:

sudo apt-get install php5-dev
sudo apt-get install php-config # *-php=no didn't quite work out for me
sudo ./configure --with-haskell=no  # with-haskell=for-great-good did NOT work

and then configure/make/install thrift and fb303