Skip to content

Instantly share code, notes, and snippets.

@si14
si14 / dags.md
Last active October 23, 2015 14:55
  1. for "missing?" we often need to query database to check if an item exists. If predicates are truly independent, we will need to do the query again to return the item.
  2. "data flow" looks something like this (in Prismatic's Graph lib):
(def stats-graph
  {:n  (fnk [xs]   (count xs))
   :m  (fnk [xs n] (/ (sum identity xs) n))
   :m2 (fnk [xs n] (/ (sum #(* % %) xs) n))
   :v  (fnk [m m2] (- m2 (* m m)))})
@essen
essen / http_specs.md
Last active January 10, 2022 02:01
HTTP and related specifications
@willurd
willurd / web-servers.md
Last active May 19, 2024 20:19
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
{:live-repl {:repl-options {:port 4555}}
:user {:plugins [[lein-clojars "0.9.1"]]
:aliases {"live" ["with-profile" "default,live-repl" "repl"]}}}
@goc9000
goc9000 / pgessays.py
Last active February 25, 2022 22:49 — forked from olasitarska/pgessays.py
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Original script: Ola Sitarska <ola@sitarska.com>
Improved version: Cristian Dinu <goc9000@gmail.com>
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
The checking facility requires epubcheck: http://code.google.com/p/epubcheck/
Embedding the 'Roots of Lisp' paper requires the programs ps2pdf and pdftoppm
@proger
proger / netstat.erl
Created November 22, 2012 16:39
netstat for erlang gen_tcp
-module(netstat).
-compile([export_all]).
-record(sock, {port, local, peer, stat, proc}).
retinfo({State, Term}) when is_atom(State) ->
Term.
sockinfo(Port, PortInfo) ->
Proc = proplists:get_value(connected, PortInfo),
1) Use build_flymake.sh to compile flymake.erl into the eflymake script.
2) Replace your existing eflymake script with the newly built one.
NOTE: Don't forget to make a back up copy of your original eflymake in case this one has bugs!
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active May 20, 2024 13:01 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.