Skip to content

Instantly share code, notes, and snippets.

View lenards's full-sized avatar

Andrew Lenards lenards

  • Tucson, AZ
View GitHub Profile
@ewdurbin
ewdurbin / subnetme.py
Last active August 29, 2015 14:05
subnetted
import sys
import itertools
from netaddr import IPNetwork
from netaddr import cidr_merge
AWS_RESERVED_IPS = 5
ALLOCATIONS = {
@artgillespie
artgillespie / rmws
Created November 24, 2011 20:52
Remove trailing whitespace from all source files under the current dir
#!/bin/sh
#
# Removes trailing whitespace from all source files in the current directory and its children.
# Note the `-i .bak` switch to sed. This will create a backup copy alongside any modified files
# like `Somefile.cpp.bak` Simply remove the `.bak` argument to `-i` to prevent the backup
# files from being generated
#
/usr/bin/find . -type f -and \( -name '*.m' -or -name '*.h' -or -name '*.mm' -or -name '*.cpp' -or -name '*.c' \) -and -print0 | xargs -0 sed -i .bak -E "s/[[:space:]]+$//"
@lenards
lenards / gist:7340034
Last active December 27, 2015 14:19 — forked from bhardin/gist:7339955
How @ messages in Hipchat should be used

The @ Symbol in Hipchat

At KISSmetrics our team is distributed around the global in 5 different timezones. When we interview candidates a common question asked is how do we like working remotely from one another. We love it. We use Hipchat as our water cooler, breakroom, and discussion area.

However, there is one thing in Hipchat that needs to be explained. By default, Hipchat will make a noise and bounce in your dock anytime a message is sent. This can become annoying during the work day since Hipchat is used as a water cooler and most of the stuff discussed is not mission critical. You are able to turn this functionality off, and most of us do. But this brings up the notification when someone is @ mentioned.

The dreaded @ symbol. In Hipchat, anytime someone mentions you with your defined @ handle the dock bounces and a sound goes off. This means that someone is attempting to bring something to your attention (and this is likely to be an urgent matter). There is also an @all that will ping ever

@clay-whitley
clay-whitley / export_processor.md
Last active April 5, 2017 04:53
km-export-processor Documentation

km-export-processor gem

The purpose of this gem is to consume the JSON that KISSmetrics exports to an S3 bucket, and transform it in a variety of useful ways.

The core features are:

  • JSON compiler : Aggregates all KISSmetrics JSON files in a directory, into a single (nonstandard) file.
  • JSON to JSON converter : Converts a nonstandard JSON file into standard format.
  • JSON to CSV converter : Converts a nonstandard JSON file into a CSV file, where each row is an event/property/alias.
  • Reimporter : Takes a nonstandard JSON file, and an API key, and sends the data in the JSON file to the product using the KMTS gem.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)
@ChillyBwoy
ChillyBwoy / cookie.js
Created May 26, 2011 00:35
Cookie functions for underscore.js
input[type='checkbox'].check-custom ~ .check-toggle {
width: 1rem;
height: 1rem;
position: relative;
display: inline-block;
vertical-align: middle;
border: 2px solid #969696;
border-radius: 50%;
cursor: pointer;
}
/* Styles for hiding the native radio button */
input[type='radio'].check-custom {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}
/* Styles for hiding the native checkbox */
input[type='checkbox'].check-custom {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
}