Skip to content

Instantly share code, notes, and snippets.

View ghuysmans's full-sized avatar

ghuysmans

  • Belgium
  • 17:20 (UTC +02:00)
View GitHub Profile
@jm3
jm3 / looking for the mouse.md
Last active May 2, 2024 14:11
Gin, Television, and Social Surplus

Gin, Television, and Social Surplus, or, “Looking for the Mouse”

Clay Shirky / April 26, 2008

transcription of a speech [Clay Shirky] gave at the Web 2.0 in 2008, emphasis by @jm3

I was recently reminded of some reading I did in college, way back in the last century, by a British historian arguing that the critical technology, for the early phase of the industrial revolution, was gin.

The transformation from rural to urban life was so sudden, and so wrenching, that the only thing society could do to manage was to drink itself into a stupor for a generation. The stories from that era are amazing-- there were gin pushcarts working their way through the streets of London.

And it wasn't until society woke up from that collective bender that we actually started to get the institutional structures that we associate with the industrial revolution today. Things like public libraries and museums, increasingly broad education for children, elected leaders--a lot of th

@whitequark
whitequark / README.md
Created December 12, 2013 06:54
A simple symbolizer for caml-inspect.

Caml-inspect symbolizer

Symbolizes closure blocks. Works only on native executables.

Build

ocamlfind ocamlopt -syntax camlp4o -package lwt -package lwt.syntax -package lwt.unix str.cmxa -linkpkg symbolizer.ml -o symbolizer
ocamlfind ocamlopt -package inspect -linkpkg foo.ml -o foo

Use

@pneff
pneff / Back Template
Created February 14, 2014 08:33
Anki Card Type for multiple-choice
<div class="check-container"><span id="check"></span></div>
{{#Question}}
<p>{{Question}}</p>
{{/Question}}
{{#Image}}
<p class="image">{{Image}}</p>
{{/Image}}
@bobot
bobot / ocompl.ml
Created April 5, 2014 08:30
Automatic generation of zsh completion from an extended Arg description
(* thx example for tagpix.pl *)
open Printf
let trim s =
let len = String.length s in
let rec aux = function
| n when n = len -> ""
| n ->
if s.[n] <> ' '
(* Dimensional analysis in OCaml, using only Hindley-Milner
with variance annotations!
The technique for representing typelevel integers that we use
here is from the talk "Many Holes in Hindley-Milner", by
Sam Lindley (http://www.kb.ecei.tohoku.ac.jp/ml2008/slides/lindley.pdf) *)
(* This type needs to be covariant so we can
generalize one : ('_a, '_a suc) int to ('a, 'a suc) int *)
(* It is also necessary to make it concrete so we don't
allow circular types such as ( 'a suc as 'a, 'a ) int *)
@rgrinberg
rgrinberg / type_safe_routes.ml
Created December 14, 2014 20:11
type safe routes opium
open Core.Std
module Substring = struct
include Substring
let get t i = (Substring.base t).[(Substring.pos t) + i]
let drop_prefix_str t ~prefix =
let len = String.length prefix in
if len > Substring.length t then None
else
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@parmentf
parmentf / GitCommitEmoji.md
Last active July 4, 2024 10:57
Git Commit message Emoji
@Drup
Drup / difflist.ml
Last active June 12, 2023 17:26
Difference lists and Miniformat
type ('ty,'v) t =
| Nil : ('v, 'v) t
| Cons : 'a * ('ty, 'v) t -> ('a -> 'ty, 'v) t
let cons x l = Cons (x,l)
let plus1 l = Cons ((),l)
let one x = Cons (x,Nil)
from graphviz import Digraph
from torch.autograd import Variable
import torch
def make_dot(var, params=None):
if params is not None:
assert isinstance(params.values()[0], Variable)
param_map = {id(v): k for k, v in params.items()}