A Pen by Samuli Tuomola on CodePen.
This file contains 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
#!/usr/bin/env python | |
""" | |
http://www.elmerproductions.com/sp/peterb/BDCFF/ | |
http://www.gratissaugen.de/erbsen/bdcff.html | |
""" | |
from __future__ import print_function | |
__email__ = 'samuli@tuomola.net' | |
import re |
dnd alignr ('-' * 10) Search imdb for cast of a title, dragndrop them to alignment grid and set captions
A Pen by Samuli Tuomola on CodePen.
This file contains 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 flask import Flask, request, jsonify | |
from flaskutils import cors | |
from lxml import html | |
import os, re, sys | |
import logging | |
## config | |
logging.basicConfig( |
This file contains 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
// assumes min < max | |
function wrap(v, min, max) { | |
if (v < min) | |
return max - ((min-v) % Math.abs(max-min)); | |
else if (v > max) | |
return min + ((v-max) % Math.abs(max-min)); | |
else | |
return v; | |
} |
This file contains 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
function commonEndings(words, endLen) { | |
endLen = endLen || 5; | |
var col = {}; | |
words | |
.filter(function(w){ return w.length==endLen }) | |
.forEach(function(ext) { | |
words.forEach(function(w) { | |
if(w.match(ext+"$")) col[ext] = col[ext]+1 || 1; | |
}) |
This file contains 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
#!/usr/bin/env python | |
""" | |
(c)2014, <samuli@tuomola.net> | |
""" | |
import sys, re | |
from datetime import datetime, timedelta | |
from os.path import isfile | |
def sub_shift(lines, dt): | |
for i,l in enumerate(lines): |
This file contains 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
<link rel="import" href="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<link rel="import" href="../paper-toast/paper-toast.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../paper-ripple/paper-ripple.html"> | |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> |
This file contains 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
# put it in .bash_aliases | |
# generates html from stdin, takes size of batch as argument | |
function openimgs { | |
MAX=${1:-6} | |
TMPL=~/openimgs-template.html | |
OUTF="openimgs-$$.html" | |
local IFS=$'\n' | |
BUF=($(cat -)) | |
local IFS=$' \n' |
This file contains 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
javascript:if(typeof(_4ac)!=='undefined') _4ac.remove(); | |
_4ac=(function() { | |
var links = [].slice.call(document.querySelectorAll('.file')); | |
var cur_link = -1; | |
var expand = true; | |
function isNext(e) { return e.keyCode == 188 || e.keyCode == 192; }; | |
function isPrev(e) { return e.keyCode == 190 || (e.keyCode == 192 && e.shiftKey); }; | |
function handleKey(e){ | |
if(isPrev(e) || isNext(e)) { | |
open(cur_link + (isPrev(e)?-1:1)); |