Skip to content

Instantly share code, notes, and snippets.

@scien
scien / gist:5b94fcd18a4885dcabdf
Created March 24, 2016 11:34
twitch player embed.js
! 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
;
(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
}
@scien
scien / gist:a1dd2656043ede6c383c
Created December 28, 2015 19:01
ballet songs
# dependencies
fs = require 'fs'
http = require 'http'
path = require 'path'
Crawler = require 'crawler'
# script
crawled = {}
c = new Crawler {
@scien
scien / gist:1aa67fc1e45de313d05c
Last active October 24, 2015 01:19
twitch player - 2015-10-23
We couldn’t find that file to show.
@scien
scien / gist:ea853fe6d08d36d99af8
Created February 19, 2015 18:02
open github issues
$('.issue-title-link').each(function(i, el) {
window.open($(el).attr('href'), '_blank')
});
@scien
scien / gist:54694d0e0180b9ac9b91
Created September 10, 2014 05:22
prune a file from git history
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch target_file.ext’ --prune-empty --tag-name-filter cat -- --all
@scien
scien / gist:cc38b2cba28bbbb30054
Last active December 2, 2016 16:05
iMessages Database
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
#!/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:['
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'
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) ->