Skip to content

Instantly share code, notes, and snippets.

Avatar

Bryant Williams scien

View GitHub Profile
View gist:5b94fcd18a4885dcabdf
! function(e, t) {
"object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define([], t) : "object" == typeof exports ? exports.video = t() : (e.Twitch = e.Twitch || {}, e.Twitch.video = t())
}(this, function() {
return function(e) {
function t(r) {
if (n[r]) return n[r].exports;
var i = n[r] = {
exports: {},
id: r,
loaded: !1
View gosquared platforms
;
(function() {
function q(f, g) {
if (!(f instanceof g)) throw new TypeError("Cannot call a class as a function");
}
function r(f, g) {
if (!f) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return !g || "object" !== typeof g && "function" !== typeof g ? f : g
}
View gist:a1dd2656043ede6c383c
# dependencies
fs = require 'fs'
http = require 'http'
path = require 'path'
Crawler = require 'crawler'
# script
crawled = {}
c = new Crawler {
@scien
scien / gist:1aa67fc1e45de313d05c
Last active Oct 24, 2015
twitch player - 2015-10-23
We couldn’t find that file to show.
View gist:ea853fe6d08d36d99af8
$('.issue-title-link').each(function(i, el) {
window.open($(el).attr('href'), '_blank')
});
@scien
scien / gist:54694d0e0180b9ac9b91
Created Sep 10, 2014
prune a file from git history
View gist:54694d0e0180b9ac9b91
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch target_file.ext’ --prune-empty --tag-name-filter cat -- --all
View gist:cc38b2cba28bbbb30054
How to connect
> sqlite3 ~/Library/Messages/chat.db
Helpful Commands
sqlite> .help
sqlite> .tables
sqlite> .headers off
sqlite> .headers on
sqlite> .mode line
sqlite> .mode list
View Created MongoDB shards for testing
#!/bin/bash
# credit: Robert Larsen
function create_shard(){
shard=$1
repl_factor=$2
shard_name="shard_${shard}"
shard_dir=shard${shard}
init='rs.initiate({_id:"'${shard_name}'",members:['
View Keen.IO-Fluentd Http Output Plugin
lass KeenHttpOutput < Fluent::Output
Fluent::Plugin.register_output('out-keen-http', self)
def initialize
super
require 'rubygems'
require 'eventmachine'
require 'em-http-request'
require 'cgi'
require 'json'
View keen.io coffee-script init
initKeenIO: (project_id, write_key) ->
window.Keen = window.Keen || {
configure: (e) ->
this._cf = e
addEvent: (e,t,n,i) ->
this._eq = this._eq || []
this._eq.push [e,t,n,i]
setGlobalProperties: (e) ->
this._gp = e
onChartsReady: (e) ->