Skip to content

Instantly share code, notes, and snippets.

View benneic's full-sized avatar

Benn Eichhorn benneic

  • Roamz
  • Sydney, Australia
View GitHub Profile
@benneic
benneic / Python2.7String.py
Created July 31, 2012 04:22
Python 2.7 String
class str(basestring):
"""
str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
"""
def capitalize(self): # real signature unknown; restored from __doc__
"""
{
'metrics' : {
'2012' : {
'm1' : 1,
'm' : {
'01' : {
'm1' : 1,
'd' : {
'01' : {
'h' : {
@benneic
benneic / segments.json
Last active December 19, 2015 14:49
Too verbose?
{
"total": 47,
"metrics": [{
"metric": "PC"
"total": 26,
}, {
"metric": "VC"
"value": 21,
}],
"services": [{
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Roman Kalyakin
#
# EC2 to Route53 magic
#
# https://gist.github.com/4449827
#
@benneic
benneic / facebook.json
Last active August 29, 2015 14:08
Examples of representing post image sizes
## /v2.2/LocalMeasure/photos
{
"data": [
{
"id": "645065645556450",
"from": {
"category": "Product/service",
"category_list": [
{
"id": "2201",
@benneic
benneic / gitbuildbump-runscript.sh
Last active July 19, 2016 02:43 — forked from jaredsinclair/set-build-number.sh
Simple, Git-friendly run script for automated build numbering in Xcode
#
# Set the build number to the current git commit count.
# If we're using the Dev scheme, then we'll suffix the build
# number with the current branch name, to make collisions
# far less likely across feature branches.
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/
#
# Updated with dSYM handling from http://yellowfeather.co.uk/blog/auto-incrementing-build-number-in-xcode-revisited/
#
GET request (no body):
Connected to 54.83.83.185:80
HTTP/1.1 200 OK
Content-Length: 40
Content-Type: text/plain; charset=utf-8
Date: Tue, 14 Feb 2017 07:05:33 GMT
Connection: keep-alive
Body discarded
@benneic
benneic / Makefile
Created February 28, 2019 00:01 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@benneic
benneic / Makefile
Last active August 14, 2019 12:23
Makefile skeleton for Docker with colourised output
ROOT := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
HUB := benneic
NAME := myproject
VERSION := latest
TAG := $(HUB)/$(NAME):$(VERSION)
DATE := `date "+%Y-%m-%d"`
# echo output in cyan
define cecho
@tput setaf 6
@benneic
benneic / Amazing-CLI-Archive.md
Last active October 16, 2019 01:38
reverse-i-search: A command line history archive (because my memory just aint that good)

My personal reverse-i-search: A command line history lookup (because my memory just aint that good)