Skip to content

Instantly share code, notes, and snippets.

View oleiade's full-sized avatar
🐫
OCamling

Théo Crevon oleiade

🐫
OCamling
View GitHub Profile
@oleiade
oleiade / probabilities_notations.yaml
Last active August 29, 2015 13:57
Probabilities notations for humans
P(this):
humanized: "probability of this fact to be true"
examples:
- "P(X) really means WHAT IS(The probability of this fact not to be true)"
P(~that):
humanized: "probability of that fact not to be true"
examples:
- P(~X) really means WHAT IS(The probability of that fact not to be true)"
### Keybase proof
I hereby claim:
* I am oleiade on github.
* I am oleiade (https://keybase.io/oleiade) on keybase.
* I have a public key whose fingerprint is 7BC5 93AE 6E89 1305 B530 4CB5 7AEA 4733 9DF4 D759
To claim this, I am signing this object:
@oleiade
oleiade / oneline.awk
Created November 5, 2014 10:02
Oneline
{
printf "%s\\n", $0
}
END { print "" }
@oleiade
oleiade / desired_output.txt
Last active August 29, 2015 14:27
Grouping by state
State Passed Failed Errored Cancelled Started
FinishedAt
2014-07-06 43 23 5 5 5 5
2014-07-13 25 19 1 5 5 5
2014-07-20 141 99 9 27 27 27
2014-07-27 111 82 6 20 20 20
2014-08-03 140 96 19 18 18 18
2014-08-10 131 95 11 15 15 15
2014-08-17 123 87 19 13 13 13
2014-08-24 133 86 35 11 11 11
@oleiade
oleiade / rclean.py
Created July 8, 2011 09:32
Recursive clean script, removes every given -f option filetype from current base directory and in subdirectories
#!/usr/bin/python
import fnmatch, subprocess
import sys, os
import argparse
def generate_filename_pattern(pattern):
try:
if pattern[0] == '.':
#!/usr/bin/env python
import sys
import pprint
from time import sleep
import twitter
import redis
API_CREDENTIALS = {
@oleiade
oleiade / flies_will_fly.py
Created November 21, 2011 14:28
Flies will fly
#!/usr/bin/env python
import time
import random
import sys
import pygame
from pygame import gfxdraw
from pygame.time import Clock
from pygame import DOUBLEBUF, HWSURFACE
#include <iostream>
#include <fstream>
#include <string>
#include <boost/algorithm/string.hpp>
#include "dump.hh"
#include "constants.hh"
#include "leveldb/db.h"
#include "leveldb/write_batch.h"
@oleiade
oleiade / pre-commit.py
Created February 23, 2012 17:47
requirements.txt package blacklisting git pre-commit hook
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
MANUAL_PACKAGES = dict.fromkeys([
'leveldb',
])
@oleiade
oleiade / decorators.py
Created February 24, 2012 09:21
Python snippets
def memoize(func, cache, num_args):
"""
Wrap a function so that results for any argument tuple are stored in
'cache'. Note that the args to the function must be usable as dictionary
keys.
Only the first num_args are considered when creating the key.
"""
@wraps(func)
def wrapper(*args):