- Install Chrome extension HTTPS Everywhere
- I have Version: 2015.5.28
- Visit http://lanyrd.com/
- Click Signin
- A JS error popup should appear saying
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division, print_function | |
from collections import defaultdict | |
from operator import itemgetter | |
get_values = itemgetter(1) | |
last_few_herders = """ | |
Nicholas | |
Gautier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var b = document.getElementsByTagName('body')[0]; | |
otherlib = false; | |
if (typeof jQuery != 'undefined') { | |
console.log('This page already using jQuery v' + jQuery.fn.jquery); | |
} else if (typeof $ == 'function') { | |
otherlib = true; | |
} | |
function getScript(url, success) { | |
var script = document.createElement('script'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2-_129-_256-Ā_17-_144-_271-ď_257-ā_384-ƀ_511-ǿ_4097-ခ_4224-ႀ_4351-ჿ_65537-𐀁_65664-𐂀_65791-_1048577-_1048704-_1048831- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[206096504910900498493010377380239941762L, 27, 241, 468, 206096504910900498493010366855655511824L, -340, 206096504910900498493010370573292788646L, 6, -188, 206096504910900498493010365575630902925L] | |
[21895897394889366278002048857818986990125268678994617770323631L, -5, 73453863292979521160722570724395436702110210638363401802874390L, 860083230267801667615814962096447759118030419081884684367195374L, 1208756186641563556189216823181235577582763775470322786885255197L, 563574118372954898036644503963904424109207146483853094148809633L, 20, -1464475540476225476021127290449598226042060199991921137850322312L, -1554085104269531629275069816677895447025824915356256971517138516L, 658781301413442456187105669962066361153531021415203972856482081L, 1421770204015349061297731987862436233014697243702547161097469746L, 1111082349050193290192329277649104120747717126931126127983058755L, -109571337096131499455011271023310218778431969690802066031870575L, -1536409144373002107386864029818511666641780965936236899633623888L, 0, 14137316515470 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://twitter.com/raymondh/status/617049150606028801 | |
#python tip: The modulo operation x % y gives a result with the same sign as y and with abs(result) < abs(y): | |
>>> 11 % 7 | |
4 | |
>>> 11 % -7 | |
-3 | |
""" | |
import math | |
from hypothesis import given, assume |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pycosat | |
import numpy | |
import itertools | |
blank_idx = 0 | |
queen_idx = 1 | |
def get_cnf(): | |
# * add one because 0 is reserved in picosat | |
# * object type because pycosat expects 'int's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from django.core import management | |
from django.conf import settings | |
def load_ensured_fixture(fixture_path): | |
""" | |
Load a fixture with a path like 'my_app/fixtures/test_initial_data.json' |
Use pytest_configure
to patch pytest/_pytest/assertion/rewrite.py::rewrite_asserts
Note: I'm now in the process of converting this guide to a pytest plugin.
git clone [email protected]:/c3537c2f2b2b8172f83e.git display_ast_rewrite
cd display_ast_rewrite
pip install -r requirements.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
import httpretty | |
@pytest.yield_fixture | |
def mock_out_devpi(): | |
httpretty.reset() | |
httpretty.enable() | |
# prevent all other urls, except those registered | |
httpretty.HTTPretty.allow_net_connect = False | |
hosts = ('pypi.local', 'pypi-zonza.company.local') |