Skip to content

Instantly share code, notes, and snippets.

View shuhblam's full-sized avatar

Cole Gillespie shuhblam

  • Tanium
  • Raleigh, North Carolina
View GitHub Profile
@shuhblam
shuhblam / public_index.html
Last active January 8, 2022 20:30
fxhash template
<!DOCTYPE html>
<html>
<head>
<title>FXHASH project</title>
<meta charset="utf-8">
<script id="fxhash-snippet">
//---- do not edit the following code (you can indent as you wish)
let alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
var fxhash = "oo" + Array(49).fill(0).map(_=>alphabet[(Math.random()*alphabet.length)|0]).join('')
let b58dec = str=>[...str].reduce((p,c)=>p*alphabet.length+alphabet.indexOf(c)|0, 0)
I am attesting that this GitHub handle shuhblam is linked to the Tezos account tz1b37erGvRoFPXBuz1DKyZwdKsxMbyt8eq1 for tzprofiles
sig:edsigtrAsWAMYRbD9fgEu6wPcG8T9tJ4cWpvynLXid63TFja6FkagQDT4iAJJ8355RWhwgykqTR9shtnqez7NPYBYE8kFEiovXQ
I am attesting that this GitHub handle shuhblam is linked to the Tezos account tz1b37erGvRoFPXBuz1DKyZwdKsxMbyt8eq1 for tzprofiles
sig:edsigtrAsWAMYRbD9fgEu6wPcG8T9tJ4cWpvynLXid63TFja6FkagQDT4iAJJ8355RWhwgykqTR9shtnqez7NPYBYE8kFEiovXQ
@shuhblam
shuhblam / Ledger_3_commands.dat
Created December 27, 2018 16:47 — forked from agaviria/Ledger_3_commands.dat
Collection of ledger-cli commands
# comments example for .dat or .ledger files
@smallexample
; 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:
@shuhblam
shuhblam / power state.md
Last active October 19, 2017 21:15
known power state events

known power states

Darkwake

add info about what can happen in darkwake here

EC.ACAttach/Maintenance

  • 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.

@shuhblam
shuhblam / gist:f7d355e28c68d82e48a8
Last active September 10, 2015 15:39 — forked from paulirish/gist:4158604
Learn JavaScript concepts with recent DevTools features

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.

Closures

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:

driver.executeAsyncScript(function() {
var callback = arguments[arguments.length - 1];
window.onload = function() {
callback()
};
}).then(function() {
//do stuff here
});
@shuhblam
shuhblam / gist:6e1e3330cf8895616eef
Last active August 29, 2015 14:17
simple update of mongo documents
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) {
@shuhblam
shuhblam / rule30.html
Created December 30, 2014 12:44
rule 30
<!doctype html>
<html lang="en" >
<head>
<style type="text/css">
header {
padding: 15px 0;
}
#eca{
outline: 1px solid black;
}