Skip to content

Instantly share code, notes, and snippets.

View ahonnecke's full-sized avatar

Ashton Honnecke ahonnecke

View GitHub Profile
ahonnecke@mes-MacBook-Pro:~/$ brew doctor
Your system is ready to brew.
ahonnecke@mes-MacBook-Pro:~$ brew install -v php55 --with-odbc --with-debug 2>&1
==> Downloading http://www.php.net/get/php-5.5.4.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php55-5.5.4
tar xf /Library/Caches/Homebrew/php55-5.5.4
==> ./configure --prefix=/usr/local/Cellar/php55/5.5.4 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.5 --with-config-file-path=/usr/local/etc/php/5.5 --with-config-file-scan-dir=/usr/local/etc/php/5.5/conf.d --with-iconv-dir=/usr --enable-dba --with-ndbm=/usr --enable-exif --enable-soap --enable-wddx --enable-ftp --enable-sockets --enable-zip --enable-shmop --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-mbstring --enable-mbregex --enable-bcmath --enable-calendar --with-zlib=/usr/local/opt/zlib --with-ldap --with-ldap-sasl=/usr --with-xmlrpc --with-kerberos=/usr --with-gd --enable-gd-native-ttf --with-freetype-dir=/usr/local/opt/freetype --with-jpeg-dir=/usr/local/opt/jpeg --with-png-dir=/usr/local/opt/libpng --with-gettext=/us
@ahonnecke
ahonnecke / gist:9882174
Created March 30, 2014 23:56
Adding try catch to MPMediaItemProperty load
From 098a4ec62e973997ec7faba5a5435975652fb9a7 Mon Sep 17 00:00:00 2001
From: Ashton Honnecke <ashton@pixelstub.com>
Date: Sun, 30 Mar 2014 17:54:05 -0600
Subject: [PATCH] try catch around mpmediaplayer metadata
---
GVMusicPlayerController/GVMusicPlayerController.m | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/GVMusicPlayerController/GVMusicPlayerController.m b/GVMusicPlayerController/GVMusicPlayerController.m
@ahonnecke
ahonnecke / ec2-printconfig.py
Created June 23, 2017 16:45 — forked from ttddyy/ec2-printconfig.py
a python script to display ec2 name and ip address as ssh-config or hosts file.
#! /usr/bin/env python
import argparse
import os
import sys
import boto.ec2
def parse_args():
@ahonnecke
ahonnecke / multihooks.py
Created July 17, 2018 17:34 — forked from carlos-jenkins/multihooks.py
Delegating script for multiple git hooks
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2017 Carlos Jenkins <carlos@jenkins.co.cr>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#!/bin/sh
pipenv run isort --recursive server
@ahonnecke
ahonnecke / flake8.sh
Created July 17, 2018 18:47
autoformat python files
#!/bin/sh
FILES=`git diff --cached --name-status | grep -v node_modules | awk '$1 != "D" {print $2}' | grep -E '[.]py$' | grep -v migrations`
[ "$NOCHECK" != "" ] || [ "$FILES" = "" ] || autopep8 --in-place --aggressive --aggressive $FILES || exit 1
[ "$NOCHECK" != "" ] || [ "$FILES" = "" ] || flake8 --select=B902,E,F,W,C90 $FILES || exit 1
@ahonnecke
ahonnecke / hooker.sh
Last active July 17, 2018 18:53
Install DAD githooks
#!/bin/sh
#to execute, run this from the git repo root
#source <(curl -s https://gist.githubusercontent.com/ahonnecke/bd62acbd02f4d2d960ad86498f2554c1/raw/a404dbf1fb5a815716dbf0e780a4dedc8dada1de/hooker.sh)
cd .git/hooks
rm pre-commit.sample
mkdir pre-commit.d
curl https://gist.githubusercontent.com/ahonnecke/7de201a5e20e1e0273342956c92123c6/raw/7e276cfcb5de155168913245ef49941f0900d25b/multihooks.py --output pre-commit
chmod 755 pre-commit
@ahonnecke
ahonnecke / require_pipenv.py
Created November 20, 2018 18:14
Require pipenv activation
import os
def pipenv_check():
try:
if os.environ['PIPENV_ACTIVE']:
print("Using pipenv and " + os.environ['PIP_PYTHON_PATH'])
return True
except KeyError:
return False
@ahonnecke
ahonnecke / delta.json
Created November 21, 2018 19:33
Order Book Delta
new order book event: { timestamp: '1542828693',
bids:
[ [ '4430.47', '2.00000000' ],
[ '4429.91', '1.50000000' ],
[ '4429.44', '0.00000000' ],
[ '4429.25', '0.00000000' ],
[ '4428.62', '0.00000000' ],
[ '4428.48', '0.50000000' ],
[ '4428.14', '0.00000000' ],
[ '4428.04', '0.00000000' ],