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({

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
@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
@jeanlaurent
jeanlaurent / gist:e65e70a89da3ead4c595
Created December 2, 2015 15:55
VBoxManage.exe list hostonlyifs
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe list hostonlyifs
Name: VirtualBox Host-Only Ethernet Adapter
GUID: cd53cf39-13e8-40d0-b24d-55b04cf31c82
DHCP: Disabled
IPAddress: 192.168.56.1
NetworkMask: 255.255.255.0
IPV6Address: fe80:0000:0000:0000:2182:a89c:b9de:eabd
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType: Ethernet
FULL_BASH_VERSION=`bash --version | head -1 | cut -d' ' -f4 | cut -d'.' -f1-3`
BASH_VERSION=`bash --version | head -1 | cut -d' ' -f4 | cut -d'.' -f1`
echo "Current bash version is $FULL_BASH_VERSION"
if [[ $BASH_VERSION -ge 4 ]]; then
echo "Your BASH version is ok"
else
echo "Your BASH version is too low"
fi
@jeanlaurent
jeanlaurent / check_docker_dns.sh
Created November 19, 2015 17:55
This check the current dns setting on mac against the current dns settings in the docker machine default
diff <(scutil --dns | grep 'nameserver\[[0-9]*\]' | cut -d' ' -f5 | sort | uniq) <(docker-machine ssh default cat /etc/resolv.conf | cut -d' ' -f2)
# Docker
isMachineUp=$(docker-machine status default)
if [ $isMachineUp == "Stopped" ]; then
printf "CTRL-C now, to prevent starting default docker machine\n"
read -t 3 -p ""
docker-machine start default
fi
eval $(docker-machine env default)
echo "Active docker machine is $(docker-machine active)"

Keybase proof

I hereby claim:

  • I am jeanlaurent on github.
  • I am jeanlaurent (https://keybase.io/jeanlaurent) on keybase.
  • I have a public key whose fingerprint is 266E 1750 9C20 0805 AF53 77E9 8985 5228 9C87 6AB0

To claim this, I am signing this object: