Skip to content

Instantly share code, notes, and snippets.

/**
* Base contract that all upgradeable contracts should use.
*
* Contracts implementing this interface are all called using delegatecall from
* a dispatcher. As a result, the _sizes and _dest variables are shared with the
* dispatcher contract, which allows the called contract to update these at will.
*
* _sizes is a map of function signatures to return value sizes. Due to EVM
* limitations, these need to be populated by the target contract, so the
* dispatcher knows how many bytes of data to return from called functions.
@mapmeld
mapmeld / split-multi.py
Created December 29, 2015 06:11
Split a GeoJSON MultiPolygon FeatureCollection into GeoJSON Polygons
# split-multi.py
# open source, MIT license
import json
js = open('multipolygon.geojson', 'r').read()
gj = json.loads(js)
output = { "type": "FeatureCollection", "features": [] }
@mauvm
mauvm / Jasmine-and-Babel6.md
Created November 12, 2015 10:51
Jasmine ES6 run script for use with Babel 6
$ npm install --save babel-cli babel-preset-es2015
$ npm install --save-dev jasmine

.babelrc:

{
 "presets": ["es2015"]
@Xion
Xion / deprecated.py
Created May 26, 2013 11:49
@deprecated decorator for Python classes
import functools
import inspect
import os
import warnings
class _DeprecatedDecorator(object):
MESSAGE = "%s is @deprecated"
def __call__(self, symbol):
@nova77
nova77 / clip_magic.py
Last active October 24, 2023 18:50
copy to clipboard ipython magic
"""
Add copy to clipboard from IPython!
To install, just copy it to your profile/startup directory, typically:
~/.ipython/profile_default/startup/
Example usage:
%clip hello world
# will store "hello world"
@bobspryn
bobspryn / echosign.py
Created July 19, 2012 05:29
Working python file to create embedded echosign widget
#!/usr/bin/python
import base64
import suds
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
url = "https://secure.echosign.com/services/EchoSignDocumentService14?wsdl"
client = suds.client.Client(url, autoblend=True)
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline