Skip to content

Instantly share code, notes, and snippets.

@thebenedict
thebenedict / index-gt.html
Created June 21, 2015 17:10
Debugging google translate widget with position:fixed on ipad
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<title>GT Layout Test</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
</head>
<body>
@thebenedict
thebenedict / complaining_about_angular.js
Last active August 29, 2015 14:06
Lesson learned: when they say "data binding", they're not kidding.
/*
TLDR: I bound expensive filtering to the template and it
was run too often. After moving filtering to the controller
it's much faster.
*/
/*
So what happened with those slow filters?
I started with debounce like we discussed, but this gave only
import unittest
from StringIO import StringIO
from anagrams import find_anagrams
class AnagramsTestCase(unittest.TestCase):
"""Tests for anagrams.py"""
def test_finds_simple_anagrams(self):
"""Does it find anagrams for 'art'?"""
anas = find_anagrams(StringIO("art\nrat\ntar"))
#!/usr/bin/python
import sys
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("input_file", help="Word list as .txt, one word per line")
args = parser.parse_args()