Skip to content

Instantly share code, notes, and snippets.

View gregglind's full-sized avatar

Gregg Lind gregglind

View GitHub Profile
@gregglind
gregglind / nbbars-fragement-demos.js
Created April 28, 2015 16:32
Gijs demonstration of how bars aren't doing anything interesting with fragments
//
var notificationbox = function (w, which){ // w is a chromeWindow
//w = w || getMostRecentBrowserWindow();
switch (which) {
case "bottom-global":
//w = w || getMostRecentBrowserWindow();
let nb = w.gDataNotificationInfoBar._notificationBox;
//console.log(nb);
return nb;
@gregglind
gregglind / index.js
Created March 30, 2015 19:14
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var p = document.createElement("pre");
document.body.appendChild(p);
p.textContent="LOG";
var log = function () {
p.textContent += "\n" + Array.prototype.slice.call(arguments).join(" ")
}

Heartbeat (Self-Repair / Shield) Recipes v1.0pre

Protect. Improve. Extend.

We have the deployment. We have the channels. Time to actually DO THINGS.

Goals:

Today

/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
#!/usr/bin/env node
require('shelljs/global');
config.fatal = true;
var args = process.argv.slice(2);
var target = {};
var help = function () {
console.log("== Available targets == \n");
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
var fs = require("fs"),
path = require("path");
module.exports = function(blanket){
var traceur = require("traceur");
var oldLoaderJS = require.extensions['.js'];
require.extensions['.js'] = function(localModule, filename) {
var pattern = blanket.options("filter");
@gregglind
gregglind / todo-v-skip.js
Last active August 29, 2015 14:13
Example of todo vs skip semantics re: https://github.com/mochajs/mocha/issues/1510
// license: Public Domain
//it.todo = it.skip;
it.todo = function (title, callback) {
return it.skip("TODO: " + title, callback)
}
describe("todo vs skip", function () {
it.skip("skipped test", function () {
@gregglind
gregglind / poisson_process_over_unkown_session_length.r
Last active August 29, 2015 14:11
poisson_process_over_unkown_session_length.r
# given a total T, have an algorithm that
# generates events over (0,t), t <=T with
# proportion t/T
#
require("triangle")
eventSim <- function (sampler_fn, n, events=1, reps=1000) {
x <- replicate(reps,(function(events){
r <- sampler_fn(n) # length
# r <- rexp(n,.01) # mean = var = 1/.01 = 100
"""
======================================================
Classification of text documents using sparse features
======================================================
This is an example showing how scikit-learn can be used to classify documents
by topics using a bag-of-words approach. This example uses a scipy.sparse
matrix to store the features and demonstrates various classifiers that can
efficiently handle sparse matrices.