Skip to content

Instantly share code, notes, and snippets.

View gregglind's full-sized avatar

Gregg Lind gregglind

View GitHub Profile
@gregglind
gregglind / addon-lint-consumer.js
Created July 27, 2016 19:34
Takes output from `addon-lint`, and errors or not based on a user-specified set of ignore rules.
#!/usr/bin/env node
/*
usage:
```
jpm xpi # makes myaddon.xpi
npm install addon-linter
./node_modules/.bin/addon-linter myaddon.xpi | node addon-lint-consumer.js
```
@gregglind
gregglind / git-in-bash.md
Created July 27, 2016 14:56
Git'ing Better All The Time

Making Git Awesome In Your CLI

Ye Olde School - Improve it with Bash

  1. Git info in your prompt

    brew install vcprompt

    vcprompt original link

@gregglind
gregglind / loops.js
Last active July 27, 2016 02:20
Loop Party, You are invited.
/* some wild-ass loop parties */
var x = 6;
var numberArray = [
1, /* 0th item, b/c arrays *index* from 0 */
2, /* 1st item */
3 /* 2nd item */
];
@gregglind
gregglind / cors.js
Last active March 9, 2016 17:48
failed cors
log = console.log.bind(console);
error = console.error.bind(console);
function cors1 (url, method, data) {
return new Promise(function (resolve, reject) {
var createCORSRequest = function(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Most browsers.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
@gregglind
gregglind / RunBetter.md
Last active February 17, 2016 14:52
A Self Checklist for novice runners, and those are looking for more ways to get better.

The Run Better Self Check Routine

Everything stopping you from running faster, harder, stronger:

Running is a very complex activity. You may or may not have the potential to be elite. You always have the potential to improve. This checklist is meant to help you find areas to work on, and maintain good practices. It's a big list! The opportunity is that there is always something to work on, even on your blackest days.

Claim 1: Run Smarter >> Run Harder.

Claim 2: Fast improvement comes from fixing your weakest areas.

@gregglind
gregglind / HB-monitoring.md
Created December 16, 2015 19:36
Queries for On-going Heartbeat Monitoring

version: 1

Has Recent Data / Lag

# anything in the last 24 hours
# This should freak out if it's 0.
# CATCHES:  complete system failure

SELECT count(received_ts)
@gregglind
gregglind / firstWeekSpark.md
Created November 5, 2015 17:34
Some notes from the first week of spark use.

Week One Experiences with Unified Telemetry Spark Stuff

Author: Gregg Lind

Analysis 1: Flash on Day 0 (Point in Time)

Approach: get_pings for a day.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
^C46934 glind ~/gits/fjord [git:master_]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'trusty64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'trusty64' (v0) for provider: virtualbox
default: Downloading: https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box
==> default: Successfully added box 'trusty64' (v0) for 'virtualbox'!
==> default: Importing base box 'trusty64'...
var URL = "https://geo.mozilla.org/country.json";
var URL = "http://people.mozilla.org/~glind/";
var myHeaders = new Headers();
var myInit = { method: 'GET',
headers: myHeaders,
mode: 'cors',
cache: 'default' };
var myRequest = new Request(URL,myInit);