This file contains 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
// The 6 ways to uwnrap optionals in Swift 2.0 | |
// | |
// Created by Patrick Lynch on 6/28/15. | |
// Copyright © 2015 Patrick Lynch. All rights reserved. | |
import Foundation | |
// 1. Force Unwrapping | |
// 2. Optional Binding | |
// 3. Optional Chaining |
This file contains 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
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
This file contains 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
#! /usr/bin/env python | |
''' | |
This is more of a personal reference as I use json very often. | |
The httplib2 examples are VERY good, and you should refer to them: | |
http://code.google.com/p/httplib2/wiki/Examples | |
''' | |
from httplib2 import Http | |
try: |
This file contains 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
Using MongoDB in golang with mgo |
The standard names for indexes in PostgreSQL are:
{tablename}_{columnname(s)}_{suffix}
where the suffix is one of the following:
pkey
for a Primary Key constraint;key
for a Unique constraint;excl
for an Exclusion constraint;idx
for any other kind of index;
This file contains 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
// Report on "stuck" ether in empty contracts | |
// https://github.com/ethereum/EIPs/issues/156 | |
// Usage: node find-stuck-ether.js [startBlock] [endBlock] > report.txt | |
let Eth = require('ethjs'); | |
let eth = new Eth(new Eth.HttpProvider('http://localhost:8545')); | |
let ethutil = require('ethereumjs-util') | |
async function main() { |
System: Mac OS Sierra (10.12.6)
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go
directory by:
OlderNewer