Skip to content

Instantly share code, notes, and snippets.

View redo_f.py
from coverage.debug import NoDebugging
from coverage.sqldata import SqliteDb
db = SqliteDb("cov.db", NoDebugging())
with db:
db.executescript("CREATE TABLE coverage_schema (\n -- One row, to record the version of the schema in this db.\n version integer\n);\n\nCREATE TABLE meta (\n -- Key-value pairs, to record metadata about the data\n key text,\n value text,\n unique (key)\n -- Keys:\n -- 'has_arcs' boolean -- Is this data recording branches?\n -- 'sys_argv' text -- The coverage command line that recorded the data.\n -- 'version' text -- The version of coverage.py that made the file.\n -- 'when' text -- Datetime when the file was created.\n);\n\nCREATE TABLE file (\n -- A row per file measured.\n id integer primary key,\n path text,\n unique (path)\n);\n\nCREATE TABLE context (\n -- A row per context measured.\n id integer primary key,\n context text,\n unique (context)\n);\n\nCREATE TABLE line_bits (\n -
View gist:e3f4da37dbd9780c2a38d66410575d5f
Verifying my Blockstack ID is secured with the address 1BiZLepEsXvm4QCUadQQGNt6W9FxGhA8UN https://explorer.blockstack.org/address/1BiZLepEsXvm4QCUadQQGNt6W9FxGhA8UN
View common3.txt
cwd is now '/home/jenkins/workspace/edx-platform-test-subset'
New process: executable: /home/jenkins/edx-venv/bin/python
New process: cmd: /home/jenkins/edx-venv/lib/python2.7/site-packages/pytest.py --junitxml=/home/jenkins/workspace/edx-platform-test-subset/reports/common/lib/capa/shard_3/nosetests.xml --verbose -s -p no:randomly -a not shard common/lib/capa --cov --cov-report=
New process: pid: 3340, parent pid: 3339
00003340 0000 0000 __init__(source=None, config_file='.coveragerc', branch=None)
00003340 0000 0001 erase()
-- config ----------------------------------------------------
_include: None
_omit: None
attempted_config_files: .coveragerc
View grid_spin.py
# For Drawbot
import os
canvas_h = 300
canvas_w = canvas_h * 2
n_frames = 40
grid = 10
def new_page():
newPage(canvas_w, canvas_h)
View test_analysis.py
#!/usr/bin/env python3.6
#
# For the full story: http://nedbatchelder.com/blog/201612/finding_test_coupling.html
#
import re
def read_output(filename):
failed = False
test_names = []
View gist:bb9dc2a41115ff3482c13166dfe6c229
###################
Something Something
###################
What is this?
* Some text
* Some more text.
`A link`__
View -
./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 Sep 16, 2016
Computing primes with CSS
View prime_css.html
<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 Apr 13, 2016
Demonstration of zip being its own inverse
View gist:f09c9767067e4b5c3bca01e369d1a4d7
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))
You can’t perform that action at this time.