Skip to content

Instantly share code, notes, and snippets.

View evanscottgray's full-sized avatar
🤠
herding cats

Evan Gray evanscottgray

🤠
herding cats
View GitHub Profile
@evanscottgray
evanscottgray / darkghe.css
Created June 2, 2015 20:07
github enterprise dark css syntax highlights
/*! Vibrant Ink */.ace_editor, .highlight {
background-color: #0F0F0F!important;
color: #FFF!important;
}
.pl-c {
color: #93C!important;
font-style: italic!important;
}
.c {
{
"uuid": "oaweijfoaweijfoawfijafowiawjfeoij",
"status": "FUNDED | FUNDING",
"item_details": {
"url": "link to something that is amazon or zinc",
"cost": "cost of item from amazon/zinc/whatever"
},
"campaign_details": {
"url": "link to tilt or whatever",
"contributed": "dollar amount contributed to date",
@evanscottgray
evanscottgray / client.js
Last active August 29, 2015 14:19 — forked from mklabs/client.js
var nopt = require('nopt'),
parse = require('url').parse,
WebSocket = require('faye-websocket');
//
// All based and derived on: http://www.igvita.com/2012/04/09/driving-google-chrome-via-websocket-api
//
// The remote debugging protocol is... I don't have words right now.
// Other than thanks thanks thanks thanks x10e901920
var Chrome = require('chrome-remote-interface');
Chrome(function (chrome) {
with
(chrome) {
var url = 'http://example.com';
var params = {
'expression': 'for (var i = 0; i < 10; i++)' +
'window.open("' + url + '", "_blank");'
};
Runtime.evaluate(params, function (error, response) {
---
- name: Stop all running logspout containers
shell: "docker ps | sed -e '1d' | grep logspout | awk {'print $1'} | xargs docker stop || :"
ignore_errors: yes
when: force_pull
- name: delete all Logspout containers
shell: "docker ps -a | grep logspout | awk '{print $1}' | xargs docker rm -f || :"
ignore_errors: yes
when: force_pull
@evanscottgray
evanscottgray / wow.txt
Created March 9, 2015 21:53
many terabytes
[root@shinystorage tank]# zpool iostat tank
capacity operations bandwidth
pool alloc free read write read write
---------- ----- ----- ----- ----- ----- -----
tank 14.2G 18.1T 0 126 0 15.4M
[root@shinystorage tank]# zpool status tank -v
pool: tank
body {
background: black !important;
color: white !important;
}
span {
background: black;
color: white !important;
}
@evanscottgray
evanscottgray / short.rb
Created February 21, 2015 01:16
link short
require 'sinatra'
require 'redis'
require 'json'
require 'securerandom'
get '/l/:token' do
redis = Redis.new
token_contents = redis.get(params[:token])
if token_contents
redirect token_contents
@evanscottgray
evanscottgray / so_much_dict.py
Created February 18, 2015 20:54
subclass dict
class FileCache(dict):
def __init__(self, *args, **kwargs):
self._filename = kwargs.pop('filename', None)
dict.__init__(self, *args, **kwargs)
def __missing__(self, key):
if self._filename:
with open(self._filename, 'r') as f:
self.update(json.load(f))
function getProgress() {
$.ajax({
dataType: "json",
url: '/progress'
})
.done(function (data) {
var total = data.total;
var current = data.current;
var percentage = (current / total * 100);
$('.progress .progress-bar').width(percentage + '%');