Skip to content

Instantly share code, notes, and snippets.

I am attesting that this GitHub handle burnto is linked to the Tezos account tz1X9vqnoa374JHKcCDWQK5Y4w2GHywQkJmF for tzprofiles
sig:edsigtw2HE71wM5Y9FknM52gFwrGjrGwCznd2F2ErUx7NZVgwYSWQesNrMrjsuxkKNZFZUNdu36HKpveutdRGVCUdqG1cNJ3tK6
@burnto
burnto / gist:8d2f43d4de5f8e09de16
Last active August 29, 2015 14:14
How to create a This. bookmarklet on mobile Safari.

It's a couple extra steps, but really not too hard.

  1. Create a bookmark for "This." and save it.

  2. Go back to your bookmarks and tap "Edit".

  3. Select your "This." bookmark.

  4. Replace the URL with the following:

    javascript:%28function %28d%2Cs%2Cp%29 %7Bd %3D document%3Bif %28typeof this_counter_8532 %21%3D%3D %27undefined%27%29 %7Bp %3D d.getElementById%28%27this-modal-%27 %2B this_counter_8532%29%3Bif %28p%29 %7Bp.parentNode.removeChild%28p%29%3Breturn%3B%7D%7Dthis_counter_8532%3DparseInt%28Math.random%28%29 %2A 100000%29 %2B 123456%3Bs %3D d.createElement%28%27script%27%29%3Bs.type %3D %27text%2Fjavascript%27%3Bs.setAttribute%28%27src%27%2C %27https%3A%2F%2Fthis.cm%2Fbookmarklet%2Fshim%2F%27 %2B this_counter_8532%29%3Bd.body.appendChild%28s%29%3B%7D%29%28%29%3B
    
import Foundation
let ScanLines = RegExScanFn("\n|\r|\r\n")
let ScanWords = RegExScanFn("\\s")
func RegExScanFn(regex : String) -> ((String) -> (String, String?)) {
return { (s : String) -> (String, String?) in
let ns = s as NSString
let location = ns.rangeOfString(regex, options: .RegularExpressionSearch).location
if location != NSNotFound {
+—— ——+
| |
| |
+—— ——+
+—— ——+ +————————————————+ +—— ——+ +—— ——+
| | | |
### Keybase proof
I hereby claim:
* I am burnto on github.
* I am bpf (https://keybase.io/bpf) on keybase.
* I have a public key ASDGPWj4jwqqbbOGqlc96vFYgiWxizg0Gd47axUEoQj50wo
To claim this, I am signing this object:
I am a new gist.
I have very long lines.
I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines. I have very long lines.
@burnto
burnto / wordmatch.py
Created November 21, 2012 22:09
Get all words matching a pattern
import re
def match(pattern):
"""
>>> match(' x ')
['axe', 'oxy']
>>> match('c m n l')
['communal', 'criminal', 'crumenal', 'culminal']
"""
r = re.compile('^' + re.sub(' ', '.', pattern) + '$', re.IGNORECASE)
@burnto
burnto / seeking_engineers.rst
Last active August 2, 2016 02:17 — forked from lumberlabs/seeking_engineers.rst
card.io opportunities at PayPal

Wanted: Talented engineering colleagues

We are an engineering team working on mobile payments at PayPal in San Jose. Acquired by PayPal in July 2012, card.io's founders were early employees at AdMob, and are now building software to enable simple, low-friction transactions on a mobile device.

Why you might want to work with us:
  • Tackle interesting, hard technical problems with immediate real world application.
  • Maintain a work-life balance and have fun.
  • Generous comp, benefits, and vacation.
@burnto
burnto / deep_dict_apply.py
Created April 6, 2012 17:55
A nasty deep dictionary apply utility
def deep_dict_apply(d, k_fn=None, v_fn=None):
"""
>>> def k_fn(key):
... return str(key) + "_k"
>>> def v_fn(value):
... return str(value) + "_v"
>>> dictionary = {1: {2: {3: 'hello'}}, 4: 'world'}
>>> deep_dict_apply(dictionary, k_fn, v_fn)
{'4_k': 'world_v', '1_k': {'2_k': {'3_k': 'hello_v'}}}
>>> deep_dict_apply(dictionary, k_fn)
@burnto
burnto / lumberlabs_cardio_engineering_jobs.md
Created April 6, 2012 01:51 — forked from lumberlabs/seeking_engineers.rst
Opportunities for talented engineers at Lumber Labs / card.io

Opportunities for talented engineers at Lumber Labs / card.io

Lumber Labs is a mobile payments start-up located in San Francisco. We create card.io – consumer apps and developer tools that enable simple, low-friction transactions on mobile devices. Company founders were early employees at AdMob. We are venture-funded, growing, and looking for exceptional colleagues.

Why Lumber Labs?

  • Tackle interesting, hard technical and design problems with immediate real world application.
  • Maintain a work-life balance. Enjoy every day, spend time with your friends and family, have fun at work.
  • Generous compensation, benefits, and vacation.