Skip to content

Instantly share code, notes, and snippets.

View laurent-dinh's full-sized avatar

Laurent Dinh laurent-dinh

View GitHub Profile
import numpy as np
# define letters
letter_d = [[0, 1, 0, 0], [0, 1, 2, 0]]
letter_i = [[1, 1], [2, 0]]
letter_n = [[0, 0, 1, 1, 1], [2, 0, 1, 2, 0]]
letter_h = [[0, 0, 0, 1, 1, 1], [0, 2, 1, 1, 2, 0]]
letter_names = ["d", "i", "n", "h"]
letter_paths = [letter_d, letter_i, letter_n, letter_h]
for FILENAME_WEBP in `ls $1 | grep "webp"`
do
DELAY=${DELAY:-10}
LOOP=${LOOP:-0}
echo $FILENAME_WEBP
FILENAME_WEBP_PREFIX=$(echo $FILENAME_WEBP | sed 's/\(.*\)\.webp/\1/')
echo $FILENAME_WEBP_PREFIX
n=`webpinfo -summary $FILENAME_WEBP | grep frames | sed -e 's/.* \([0-9]*\)$/\1/'`
dur=`webpinfo -summary $FILENAME_WEBP | grep Duration | head -1 | sed -e 's/.* \([0-9]*\)$/\1/'`
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
registrant_file = "current_guests.csv"
# csv file with row format "first_name,last_name,email,institution"
# email must be unique identifier
with open(registrant_file, "r") as fi:
registrant_rows = fi.readlines()
@laurent-dinh
laurent-dinh / dl_vine.py
Last active March 13, 2017 16:04
Did it for the Vine
import requests
import time
import random
from bs4 import BeautifulSoup
import argparse
import urllib
import string
parser = argparse.ArgumentParser()
parser.add_argument("--bookmarks", type=str, default="")
@laurent-dinh
laurent-dinh / unexpected_recurrent
Last active August 29, 2015 14:17
Unexpected recurrent
from theano import tensor
import numpy
from numpy.testing import assert_allclose
from blocks.bricks.recurrent import BaseRecurrent, recurrent
class UnexpectedRecurrent(BaseRecurrent):
"""`blocks.bricks.recurrent.recurrent` showing unexpected behavior =(