Skip to content

Instantly share code, notes, and snippets.

View yaf's full-sized avatar

Yannick François yaf

View GitHub Profile
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@albertstill
albertstill / enigma_machine.rb
Last active February 25, 2021 18:46
Understand how the Enigma machine works with 30 lines of Ruby
Plugboard = Hash[*('A'..'Z').to_a.sample(20)]
Plugboard.merge!(Plugboard.invert)
Plugboard.default_proc = proc { |_, key| key }
def build_a_rotor
Hash[('A'..'Z').zip(('A'..'Z').to_a.shuffle)]
end
ROTOR_1, ROTOR_2, ROTOR_3 = build_a_rotor, build_a_rotor, build_a_rotor
@thom4parisot
thom4parisot / Dockerfile
Last active August 29, 2015 14:12
Docker instance sharing with boot2docker
FROM busybox
CMD ["docker", "--tlsverify", "ps"]
@gmasse
gmasse / gist:4b0c34be3d797cd729d2
Last active February 22, 2022 16:00
OVH custom iPXE boot (dedicated server)
@jackrusher
jackrusher / drum-circle.clj
Created August 17, 2014 14:40
A little Godfried Toussaint inspired polyrhythmic drum toy online at http://jackrusher.com/drum-circle/
(ns drum-machine.core
(:require [om.core :as om :include-macros true]
[sablono.core :as html :refer-macros [html]]))
(enable-console-print!)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; UI
(def tau 6.2831853071)
@BernardNotarianni
BernardNotarianni / circus.sh
Last active August 29, 2015 13:58
Continuous build for erlang (cowboy, erlydtl...)
#!/bin/bash
# the name of your erlang app
APPNAME=yourappname
# we will monitor for any modification in those directories
WATCHEDDIRS="src templates"
# --- Functions
@davidbgk
davidbgk / index.py
Last active January 1, 2017 16:28
Implementation of Webmention https://github.com/converspace/webmention/blob/master/README.md in Python 3 as a CGI script.
#!/usr/bin/python3
import os
import cgi
import cgitb
cgitb.enable()
import subprocess
import urllib.request
form = cgi.FieldStorage()
source = form.getvalue('source', None)
anonymous
anonymous / .Xdefaults
Created September 22, 2013 09:43
My own urxvt related Xdefaults section
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: hintmedium
URxvt.font: xft:Ubuntu Mono:size=9
URxvt.scrollBar: false
URxvt.depth: 32
URxvt.foreground: #d0d0d0
! true transparency
@BernardNotarianni
BernardNotarianni / gist:6496653
Created September 9, 2013 14:49
Simple and efficient automatic test runner. Scan when a source file is modified, and then run the test suite, displaying result to the console.
#!/bin/bash
function ctrl_c {
echo "** Trapped CTRL-C"
stop_server
exit
}
# hit ctrl-c to exit the loop
trap ctrl_c INT TERM EXIT