Skip to content

Instantly share code, notes, and snippets.

@ddaws
ddaws / minimum.py
Last active August 29, 2015 13:56
I like to place this header at the top of all of my python modules.
'''!
'''
from __future__ import (
print_function,
unicode_literals,)
__author__ = 'Dawson Reid <dawson@streamlyne.co>'
import logging
@ddaws
ddaws / required.py
Created February 23, 2014 04:23
The following may be used within a setup.py file to ensure packages are installed prior to the installation process.
def is_installed(pkg):
'''
Tests if a python module is installed.
'''
try:
__import__(pkg)
return True
except ImportError:
return False
@ddaws
ddaws / rbenv-install.sh
Last active August 29, 2015 13:59
Rbenv install script I currently use with [Vagrant](http://www.vagrantup.com/) in [Development Enviroment](https://github.com/dreid93/devenv).
#!/bin/bash
RBENV_DIR=$HOME/.rbenv
if [ ! -d "$RBENV_DIR" ]; then
git clone https://github.com/sstephenson/rbenv.git $RBENV_DIR
echo 'export PATH="$RBENV_DIR/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
git clone https://github.com/sstephenson/ruby-build.git $RBENV_DIR/plugins/ruby-build
#!/bin/bash
WORKON_HOME=$HOME/.virtualenv
if [ ! -d "$WORKON_HOME" ]; then
pip install virtualenvwrapper
export WORKON_HOME=$WORKON_HOME
mkdir -p $WORKON_HOME
@ddaws
ddaws / Gruntfile.coffee
Created July 3, 2014 16:27
CoffeeScript Grunt Tools
###
Dawson Reid (dawson@streamlyne.co)
###
exec = require('child_process').exec
util = require 'util'
path = require 'path'
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-coffee'
@ddaws
ddaws / cube-it.sh
Last active August 29, 2015 14:16
Prepare linux VMs for packaging as a Vagrant Box
#!/bin/bash
# Dawson Reid
# Feb 25, 2015
# Note : Currently only supports Debian.
VAGRANT_USERNAME="vagrant"
VAGRANT_PASSWORD="vagrant"
LANGUAGE_LOCAL="en_US"
@ddaws
ddaws / Update Build Number
Created February 28, 2015 22:14
Update plist CFBundleVersion
#!/bin/sh
PLIST_FILE_NAME="Info.plist"
plist="${SRCROOT}/${PROJECT}/${PLIST_FILE_NAME}"
dir="${SRCROOT}/.."
# Only increment the build number if source files have changed
if [ -n "$(find "$dir" \! -path "*xcuserdata*" \! -path "*.git" -newer "$plist")" ]; then
buildnum=$(/usr/libexec/Plistbuddy -c "Print CFBundleVersion" "$plist")
if [ -z "$buildnum" ]; then
@ddaws
ddaws / make
Created January 9, 2016 16:20
Web3 Umbrella Build Errors
[ 0%] Built target cpp-ethereum_BuildInfo.h
[ 2%] Built target scrypt
[ 3%] Built target secp256k1
[ 3%] Built target dev_BuildInfo.h
Scanning dependencies of target devcore
[ 3%] Building CXX object libweb3core/libdevcore/CMakeFiles/devcore.dir/Base58.cpp.o
[ 3%] Building CXX object libweb3core/libdevcore/CMakeFiles/devcore.dir/Base64.cpp.o
[ 4%] Building CXX object libweb3core/libdevcore/CMakeFiles/devcore.dir/Common.cpp.o
[ 4%] Building CXX object libweb3core/libdevcore/CMakeFiles/devcore.dir/CommonData.cpp.o
[ 4%] Building CXX object libweb3core/libdevcore/CMakeFiles/devcore.dir/CommonIO.cpp.o
@ddaws
ddaws / Make libethereum console output
Created January 9, 2016 17:40
Make libethereum error
Scanning dependencies of target ethereum_BuildInfo.h
[ 0%] Built target ethereum_BuildInfo.h
Scanning dependencies of target evmjit
[ 1%] Building CXX object evmjit/libevmjit/CMakeFiles/evmjit.dir/JIT.cpp.o
[ 1%] Building CXX object evmjit/libevmjit/CMakeFiles/evmjit.dir/JIT-c.cpp.o
[ 2%] Building CXX object evmjit/libevmjit/CMakeFiles/evmjit.dir/Arith256.cpp.o
/Users/dawsonreid/Develop/Ethereum/mist/interface/webthree-umbrella/libethereum/evmjit/libevmjit/Arith256.cpp:86:14: error: no member named 'getNextNode' in 'llvm::Argument'
auto y = x->getNextNode();
~ ^
/Users/dawsonreid/Develop/Ethereum/mist/interface/webthree-umbrella/libethereum/evmjit/libevmjit/Arith256.cpp:203:17: error: no member named 'getNextNode' in 'llvm::Argument'
@ddaws
ddaws / Logs_Homebrew_cpp-ethereum_02.make
Created January 9, 2016 17:50
/Users/dawsonreid/Library/Logs/Homebrew/cpp-ethereum/02.make
2016-01-09 12:26:53 -0400
make
/usr/local/Cellar/cmake/3.4.1/bin/cmake -H/tmp/cpp-ethereum20160109-2036-a75pow -B/tmp/cpp-ethereum20160109-2036-a75pow --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.4.1/bin/cmake -E cmake_progress_start /tmp/cpp-ethereum20160109-2036-a75pow/CMakeFiles /tmp/cpp-ethereum20160109-2036-a75pow/CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cpp-ethereum_BuildInfo.h.dir/build.make CMakeFiles/cpp-ethereum_BuildInfo.h.dir/depend
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f webthree-helpers/utils/libscrypt/CMakeFiles/scrypt.dir/build.make webthree-helpers/utils/libscrypt/CMakeFiles/scrypt.dir/depend
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f webthree-helpers/utils/secp256k1/CMakeFiles/secp256k1.dir/build.make webthree-helpers/utils/secp256k1/CMakeFiles/secp256k1.dir/depend