Skip to content

Instantly share code, notes, and snippets.

@thebenedict
thebenedict / index-gt.html
Created Jun 21, 2015
Debugging google translate widget with position:fixed on ipad
View index-gt.html
<!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 Aug 29, 2015
Lesson learned: when they say "data binding", they're not kidding.
View complaining_about_angular.js
/*
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
View test_anagrams.py
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"))
View anagrams.py
#!/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()