Skip to content

Instantly share code, notes, and snippets.

@nedbat
nedbat / -
Created November 9, 2016 16:02
./conf/locale/ar/LC_MESSAGES/django-partial.prob
Different tags in source and translation
msgid: A proctored exam attempt for {exam_name} in {course_name} by username:
{student_username} was reviewed as {review_status} by the proctored
exam review provider.
-----> محاولة الامتحان المراقب لـ {review_status} في {course_name} حسب اسم
المستخدم: لقد تمت مراجعة {student_username} باعتباره {review_status}
حسب مزود معاينة الامتحان المراقب.
-----> "{exam_name}" missing
@nedbat
nedbat / prime_css.html
Created September 16, 2016 19:27
Computing primes with CSS
<html>
<head>
<style>
span { background: pink; }
span:nth-child(2n+4) { background: white; }
span:nth-child(3n+6) { background: white; }
span:nth-child(4n+8) { background: white; }
span:nth-child(5n+10) { background: white; }
span:nth-child(6n+12) { background: white; }
@nedbat
nedbat / gist:f09c9767067e4b5c3bca01e369d1a4d7
Created April 13, 2016 15:44
Demonstration of zip being its own inverse
Python 3.5.1 (default, Dec 7 2015, 06:25:20)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = list(range(5))
>>> b = list(range(100, 105))
>>> a
[0, 1, 2, 3, 4]
>>> b
[100, 101, 102, 103, 104]
>>> ab = list(zip(a, b))
18:13:11 npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
18:13:11 npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
18:13:11 npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
18:13:13 npm WARN engine escodegen@1.7.1: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.37","npm":"1.4.28"})
18:13:13 npm WARN optional dep failed, continuing fsevents@1.0.9
18:13:13 npm WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.37","npm":"1.4.28"})
18:13:16 npm WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.37","npm":"1.4.28"})
18:13:18 npm WARN engine is-buffer@1.1.3: wanted: {"node":">=0.12"} (current: {"node":"0.10.37","npm":"1.4.28"})
18:13:20 npm WARN engine is-buffer@1.1.3: wanted: {"n
with open("/tmp/foo.txt", "a") as f:
print >>f, "-----", __name__
import inspect;print >>f, ("\n".join("%30s : %s @%d" % (t[3], t[1], t[2]) for t in inspect.stack()[:0:-1]))
Verifying I am +nedbat on my passcard. https://onename.com/nedbat
@nedbat
nedbat / keybase.md
Last active August 29, 2015 13:57
keybase.md

Keybase proof

I hereby claim:

  • I am nedbat on github.
  • I am nedbat (https://keybase.io/nedbat) on keybase.
  • I have a public key whose fingerprint is CEDC 1E06 A214 B8EC 51AE 2E05 DAA4 690B 9931 E4FB

To claim this, I am signing this object: