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
def extend_instance(instance, *bases, **kwargs): | |
""" | |
Apply subclass (mixin) to a class object or its instance | |
By default, the mixin is placed at the start of bases | |
to ensure its called first as per MRO. If you wish to | |
have it injected last, which is useful for monkeypatching, | |
then you can specify 'last=True'. See here: | |
http://stackoverflow.com/a/10018792/1267398 | |
:attr cls: Target object |
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
for k in ['host', 'port', 'database', 'user', 'password']: | |
if k in dbconfig: | |
if type(dbconfig[k]) in (str, unicode): | |
match = pat.match(dbconfig[k]) | |
if match and match.groups(): | |
envvar = match.groups()[0] | |
if envvar in os.environ: | |
dbconfig[k] = os.environ[envvar] | |
if k != 'password': |
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
def extend_instance(instance, *bases, **kwargs): | |
""" | |
Apply subclass (mixin) to a class object or its instance | |
By default, the mixin is placed at the start of bases | |
to ensure its called first as per MRO. If you wish to | |
have it injected last, which is useful for monkeypatching, | |
then you can specify 'last=True'. See here: | |
http://stackoverflow.com/a/10018792/1267398 |
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 | |
import sys | |
import subprocess | |
def sanitypatch(): | |
""" | |
Quick hack to install any package we want in coderpad... | |
Because real coders use pytest, amirite? | |
""" | |
print("applying coderpad sanity patch...") |
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
Dear Zendesk, | |
On behalf of the internet, and for the greater good of mankind, this is a request to | |
politely ask you to change the default theme of your support emails. | |
Currently every support email notification, for the majority of your customers, | |
includes a complete dump of the entire conversation. And due to the way you | |
have constructed the HTML in your email, most email clients fail to realise | |
it is duplicated text and do not remove it. |
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
<!-- BEM EXAMPLE --> | |
<style> | |
.btn { display: block; color: red; } | |
.btn--orange { color: orange; } | |
</style> | |
<div class="btn btn--orange"></div> | |
<!-- NON-BEM EXAMPLE --> | |
<style> |
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 fs = require('fs'); | |
var path = require('path'); | |
var current_dir = path.dirname(fs.realpathSync(__filename)); | |
var design_docs_dir = path.join(current_dir, 'design_docs'); | |
var files = fs.readdirSync(design_docs_dir); | |
var json = {}; | |
files.forEach(function(fpath) { |
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
==Phrack Inc.== | |
Volume One, Issue 7, Phile 3 of 10 | |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
The following was written shortly after my arrest... | |
\/\The Conscience of a Hacker/\/ | |
by |
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
### Keybase proof | |
I hereby claim: | |
* I am foxx on github. | |
* I am sleepycal (https://keybase.io/sleepycal) on keybase. | |
* I have a public key whose fingerprint is 3352 5EE5 1000 1772 5033 7A4D BA90 2A3F 2D9B E20B | |
To claim this, I am signing this object: |
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 (factory) { | |
// loader from https://github.com/umdjs/umd/blob/master/jqueryPlugin.js | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(['jquery'], factory); | |
} else { | |
// Browser globals | |
factory(jQuery); | |
} | |
}(function ($) { |