This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-06/schema#", | |
"description": "A representation of an event", | |
"type": "object", | |
"required": [ "dtstart", "summary" ], | |
"properties": { | |
"dtstart": { | |
"format": "date-time", | |
"type": "string", | |
"description": "Event starting time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%matplotlib inline | |
import numpy as np | |
import matplotlib.pyplot as plt | |
fig, ax = plt.subplots(4, 1, figsize=(10, 12), sharex=True, sharey=True) | |
plt.xkcd() | |
x = np.linspace(-10, 10, 1001) | |
np.random.seed(43) | |
ax[0].set_title("How People Think Laws Work") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Sketch of an idea. If you've been commiting fixes too much recently, you | |
# should probably stop what your doing and think a bit. In teams, someone | |
# else tells you to do so. But, when your by yourself, broken glass can | |
# accumulate, until one day -- poof. | |
export MAX_FAILURES=3 | |
export LAST_N_COMMITS=10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import SVG | |
from keras.utils.vis_utils import model_to_dot | |
from keras.models import Sequential | |
from keras.layers import Dense, Activation | |
model = Sequential([ | |
Dense(32, input_shape=(784,)), | |
Activation('relu'), | |
Dense(10), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_zen_of_python(): | |
import codecs, sys | |
out = sys.stdout | |
with open(os.devnull, "w") as tmp_out: | |
sys.stdout = tmp_out | |
from this import s as zen_of_python | |
sys.stdout = out | |
return codecs.encode(zen_of_python, 'rot_13') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ftplib import FTP, error_perm, error_temp | |
# List passwords | |
passlist = ["azedaedaze" , "connerre" , "iazevbfhiazev"] | |
length = len(passlist) | |
# IP FTP | |
ftp = FTP('ftpperso.free.fr') | |
# User FTP | |
user = "esconnerre" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import numpy as np | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
def step_spiral(x_0=0, y_0=0): | |
point = (0, x_0, y_0) | |
yield point | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from aiohttp import web | |
import subprocess | |
async def uptime_handler(request): | |
# http://HOST:PORT/?interval=90 | |
interval = int(request.GET.get('interval', 1)) | |
# Without the Content-Type, most (all?) browsers will not render |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile | |
FETCH = data/raw/FETCHED | |
PROCESS = data/clean/CLEANED | |
all: $(FETCH) $(PROCESS) | |
$(FETCH): scripts/fetch.py | |
@mkdir -p data/raw | |
python scripts/fetch.py | |
@touch $(FETCH) |