Skip to content

Instantly share code, notes, and snippets.

import bitstring
import math
def binary2Int(binary:str):
number = 0
for i in range(len(binary)):
if binary[i] == "1":
number += 2 ** (len(binary) - i - 1)
return number
// JL's config for https://github.com/kasper/phoenix
// https://github.com/kasper/phoenix/blob/master/docs/API.md#javascript-api
// Press Command-Option-1 get the currently focused window taking half screen docked on the right
Key.on('1', [ 'command', 'option' ], () => {
var focusedWindow = Window.focused();
if (!focusedWindow) {
return;
}
focusedWindow.setFrame({
@jeanlaurent
jeanlaurent / .slate
Last active October 16, 2017 12:05
Slate config file
# https://github.com/mattr-/slate
#half left - full - half right
bind 1:alt,cmd move screenOriginX;screenOriginY screenSizeX/2;screenSizeY
bind 2:alt,cmd move screenOriginX;screenOriginY screenSizeX;screenSizeY
bind 3:alt,cmd move screenOriginX+screenSizeX/2;screenOriginY screenSizeX/2;screenSizeY
#1/3 left - center - right
bind 4:alt,cmd move screenOriginX;screenOriginY screenSizeX/3;screenSizeY
bind 5:alt,cmd move screenOriginX+screenSizeX/3;screenOriginY screenSizeX/3;screenSizeY

If you plan to attend this workshop in a conference, as network availibility is often flaky, please check you have the following :

  • A laptop + cord
  • Install docker 1.11
    • Install with Toolbox for windows or for Mac
    • If you haven't done it already, register for the Docker for desktop beta at https://beta.docker.com, and give us your hub account name during the session we can probably do something for you.
  • Test your docker installation works fine
    • docker run hello-world and check you see the welcome message
    • docker run -p 8080:80 nginx and open your browser to your machine on port 8080 and check you see nginx default page.
  • Warm up your local docker machine with the following images :
  • docker pull dockerdemos/lab-web
user]
name = Jean-Laurent de Morlhon
email = jeanlaurent@morlhon.net
[alias]
co = checkout
st = status
br = branch
ci = commit
pr = pull --rebase
cia = commit --amend --no-edit
<!DOCTYPE html>
<html>
<head>
<title>d3</title>
<meta charset="UTF-8">
<style>
body{margin:0px;}
.h,.v{stroke:black;stroke-dasharray:4 4;stroke-width:1;stroke-opacity:.5;}
.axis path,
.axis line {
@jeanlaurent
jeanlaurent / tapei.conf
Last active December 27, 2015 13:59
Node.js npm server upstart conf
# tapei.conf
description "This is a *very* simple elevator implementation serving as a starting point for code-story S03E01"
start on startup
stop on shutdown
script
echo $$ > /var/run/tapei.pid
class Omnibus
constructor: ->
@commands = []
reset: ->
@commands = []
call: ->
next: ->
public class Omnibus {
String commands[] = {
"OPEN","CLOSE","UP",
"OPEN","CLOSE","UP",
"OPEN","CLOSE","UP",
"OPEN","CLOSE","UP",
"OPEN","CLOSE","UP",
"OPEN","CLOSE","DOWN",
"OPEN","CLOSE","DOWN",
@jeanlaurent
jeanlaurent / watch.coffee
Created July 9, 2013 09:58
Run some script when file changes
#!/usr/bin/env coffee
fs = require('fs')
exec = require('child_process').exec
unless process.argv[3]?
console.log """
missing parameters :
watch.coffee directory_to_watch script_to_exec_on_file_change
"""
process.exit -1