Skip to content

Instantly share code, notes, and snippets.

View eschnou's full-sized avatar

Laurent Eschenauer eschnou

View GitHub Profile
@eschnou
eschnou / ohlc.py
Created July 4, 2017 08:07
Raw trades to OHLC convertor
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df=pd.read_csv("./data/bitstampUSD.csv")
df['Date'] = pd.to_datetime(df['Date']*int(1e9))
df.Date=pd.to_datetime(df.Date, unit = 's')
df = df.set_index('Date').astype('float64')
@eschnou
eschnou / gist:9dd08d9b7b0257af484c281d923ca609
Created March 18, 2017 15:16
Les Fabulations de La Fontaine
# Les Fabulations de La Fontaine
#
# Une petite fable, hallucinée par un RNN ayant appris à lire du Jean de La Fontaine
# https://github.com/eschnou/tensorflow-rnn-lafontaine
LE LOUP ET LE RAT
[Ésope]
Le Lion dit: A l'entendra la vie
De son considérer de la sorte.
L'Aigle lui dit le Rat se rat des plus sont de la main de son sang,
# Chatbot entraîné avec DeepQA sur les sous-titres français du corpus OpenSubtitles, avec
# les embeddings français de FastText.
#
# https://github.com/Conchylicultor/DeepQA/pull/83
Q: Quelle est la couleur du ciel ?
A: Elle est bonne.
Q: D'où viens-tu ?
A: Non, je suis pas prêt.
@eschnou
eschnou / git_colors.sh
Created August 4, 2016 08:15
Awesome git colors
# Awesomness in form of colors, git branch, and commit (dirty) status
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
### Keybase proof
I hereby claim:
* I am eschnou on github.
* I am eschnou (https://keybase.io/eschnou) on keybase.
* I have a public key whose fingerprint is 6F43 67EB 94C4 C9FC 42F4 0AF8 6F0D CAFA 0F9A D975
To claim this, I am signing this object:
@eschnou
eschnou / comodit-sample.py
Last active December 12, 2015 01:29
Just imagine what becomes possible when any resources from your infrastructure can be observed and manipulated through software. A short preview of the new ComodIT Python API. Learn more at http://comodit.com.
from comodit_client.api import Client
# Connect to ComodIT
client = Client('https://my.comodit.com/api', 'demo', '******')
# Define a new host
env = client.get_organization('Demo').get_environment('Default')
host = env.hosts().create('my-new-host', '', 'Demo Platform', 'Demo Distribution')
# Deploy the host
/*
* Xen domain builder -- bzImage bits
*
* Parse and load bzImage kernel images.
*
* This relies on version 2.08 of the boot protocol, which contains an
* ELF file embedded in the bzImage. The loader extracts this ELF
* image and passes it off to the standard ELF loader.
*
* This code is licenced under the GPL.