Skip to content

Instantly share code, notes, and snippets.

View alexanderattar's full-sized avatar
💭
⚡️

Alexander alexanderattar

💭
⚡️
View GitHub Profile
@alexanderattar
alexanderattar / gist:11aaa2469f76d192b5df3ed41374e959
Created April 12, 2016 16:42 — forked from patricklynch/gist:689525d466c4ada42b8e
The 6 ways to unwrap optionals in Swift 2.0
// 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
@alexanderattar
alexanderattar / celery.sh
Created July 28, 2016 20:43 — forked from amatellanes/celery.sh
Celery handy commands
/* 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.#'),
@alexanderattar
alexanderattar / httplib2_post_json.py
Created August 23, 2016 20:54 — forked from wrunk/httplib2_post_json.py
Python httplib2 POST json body with auth example
#! /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:
@alexanderattar
alexanderattar / git_branch_naming.md
Created June 20, 2017 18:38 — forked from revett/git_branch_naming.md
Git Branch Naming Conventions

<type>/<name>

<type>

bug    - Code changes linked to a known issue.
feat   - New feature.
hotfix - Quick fixes to the codebase.
junk   - Experiments (will never be merged).
@alexanderattar
alexanderattar / .Title
Created August 17, 2017 03:40 — forked from congjf/.Title
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@alexanderattar
alexanderattar / PostgreSQL_index_naming.rst
Created September 11, 2017 21:04 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

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;
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

// 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() {
@alexanderattar
alexanderattar / update-golang.md
Last active February 16, 2018 21:34 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Mac OS Sierra (10.12.6)

1. Uninstall the exisiting version

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: