Skip to content

Instantly share code, notes, and snippets.

Cole Gillespie coleGillespie

  • North Carolina
View GitHub Profile
coleGillespie / Ledger_3_commands.dat
Created Dec 27, 2018 — forked from agaviria/Ledger_3_commands.dat
Collection of ledger-cli commands
View Ledger_3_commands.dat
# comments example for .dat or .ledger files
; This is a single line comment,
# and this,
% and this,
| and this,
* and this.
# If you have a deeply nested tree of accounts,
# it may be convenient to define an alias, for example:
coleGillespie / power
Last active Oct 19, 2017
known power state events
View power

known power states


add info about what can happen in darkwake here


  • observed when a machine has the lid shit and AC power is plugged in
DarkWake from Normal Sleep [CDN] due to EC.ACAttach/Maintenance: Using AC (Charge:60%) 45 secs  

Monitoring angular $$watchers

There are a few chrome extensions that will tell you the total count of your angular $$watchers but in order to narrow down the problem areas I needed more insight into which elements were causing problems. This script helped me by giving me the ability to:

  • Quickly identify the top x elements with the highest number of $$watchers
  • Get the total $$watchers for any element including all of it's descendants
  • Get all $$watchers for the current documentElement

For debugging I recommend using chrome snippets. Paste the watcher.js script into a new snippet, save it and then run it. Once you load the snippet you can call any functions it loaded directly from the console as many times as you want.

coleGillespie / gist:f7d355e28c68d82e48a8
Last active Sep 10, 2015 — forked from paulirish/gist:4158604
Learn JavaScript concepts with recent DevTools features
View gist:f7d355e28c68d82e48a8

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.


Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

View gist:4112aa6800d210095e28
driver.executeAsyncScript(function() {
var callback = arguments[arguments.length - 1];
window.onload = function() {
}).then(function() {
//do stuff here
coleGillespie / gist:6e1e3330cf8895616eef
Last active Aug 29, 2015
simple update of mongo documents
View gist:6e1e3330cf8895616eef
var MongoClient = require('mongodb').MongoClient,
bunyan = require('bunyan'),
log = bunyan.createLogger({
name: 'harvest'
request = require('request')
var url = 'mongodb://localhost:27017/openNews';
MongoClient.connect(url, function(err, db) {
View rule30.html
<!doctype html>
<html lang="en" >
<style type="text/css">
header {
padding: 15px 0;
outline: 1px solid black;
coleGillespie / gist:c28c316c0d9756267324
Last active Aug 29, 2015
output of local violations analyzation
View gist:c28c316c0d9756267324
[cole@localhost cfa]$ python
Earliest Entry in Air Pollutants and Odors happend on 2012-12-05 00:00:00
Latest Entry in Air Pollutants and Odors happend on 2012-12-19 00:00:00
Air Pollutants and Odors has 2 total entries
Earliest Entry in Animals and Pests happend on 2012-01-03 00:00:00
Latest Entry in Animals and Pests happend on 2012-12-28 00:00:00
Animals and Pests has 180 total entries
coleGillespie /
Last active Aug 29, 2015
analyze a csv of local violations
import csv
import operator
count = 1
previousCategory = None
previousDate = None
previousCount = 1
with open('Violations-2012.csv', 'rb') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='"')
View gist:7850920
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.