Skip to content

Instantly share code, notes, and snippets.

var rawParser = bodyParser.raw({type: '*/*'});
app.post('/zipped', rawParser, function(req, res) {
console.log('here we go');
console.log('body', req.body);
console.log('req body len', req.body.length);
console.log('body.toString',req.body.toString() );
// console.log('body.toJSON', req.body.toJSON() );
var theData = req.body.toJSON();
@notionparallax
notionparallax / exampleData.json
Last active September 21, 2016 12:04
Markov generator for the things I do in my day.
[
["Lobby", "M Toilet", "M Toilet", "M Toilet", "Shower", "Out", "Shower", "Shower", "Coffee machine", "V meeting N", "V meeting N", "V meeting N", "V meeting N", "V meeting N", "V meeting N", "V meeting N", "V meeting N", "V meeting N", "Coffee machine", "Model area", "Model area", "Model area", "Model area", "Model area", "Coffee machine", "My Desk", "My Desk", "My Desk", "My Desk", "My Desk", "V meeting S", "V meeting S", "V meeting S", "V meeting S", "Coffee machine", "Coffee machine", "My Desk", "My Desk", "M Toilet", "Shower", "Coffee machine", "Hug", "Hug", "Hug", "My Desk", "Resourse Bay", "Model area", "Coffee machine", "Out", "Out", "Out", "Out", "Out", "Out", "Lobby", "Reception", "Hug", "Hug", "Hug", "Hug", "My Desk", "My Desk", "My Desk", "Coffee machine", "My Desk", "Coffee machine", "Model area", "Model area", "Model area", "Coffee machine", "Out", "Out", "Out", "Out", "Out", "Out", "Out", "Shower", "Shower", "Shower", "My Desk", "My Desk", "My Desk", "My Desk", "My Desk", "M Toilet", "M To
import itertools
import random
colours = ["#e67e22","#f1c40f","#27ae60","#1abc9c","#2980b9","#c0392b"]
places = ["Verandah","Kitchen","Toilet","Shower","Desk","Someone else's desk","Meeting N","Meeting S","Quiet N","Quiet S"]
pairs = itertools.combinations(places, 2)
pairs = list(pairs)
@notionparallax
notionparallax / possible_usernames.py
Created June 22, 2016 18:27
My twitter name is a bit long. I was wondering if there were any good, shorter ones out there. This is a naive way of finding out, but it gets banned by twitter pretty quickly.
#example response: {"valid":false,"reason":"taken","msg":"Username has already been taken","desc":"That username has been taken. Please choose another."}
permissableChars = list("abcdefghijklmnopqrstuvwxyz_1234567890")
import json
import urllib2
import itertools
possibleUsernames = []
function servePhoto(request) {
var storageUrl = request.url.replace(/-\d+px\.jpg$/, '');
return caches.open(contentImgsCache).then(function(cache) {
return cache.match(storageUrl).then(function(response) {
if (response) return response;
return fetch(request).then(function(networkResponse) {
cache.put(storageUrl, networkResponse.clone());
return networkResponse;
--------------------------------------------------------------------------------------------------------------------------- Class 1
public class Script_Instance : GH_ScriptInstance
{
#region Utility functions
/// <summary>Print a String to the [Out] Parameter of the Script component.</summary>
/// <param name="text">String to print.</param>
private void Print(string text) { /* Implementation hidden. */ }
/// <summary>Print a formatted String to the [Out] Parameter of the Script component.</summary>
/// <param name="format">String format.</param>
/// <param name="args">Formatting parameters.</param>

This is a plugin meant for Jekyll.

It's a fork of joelverhagen's youtube plugin. This version is for bootstrap responsive embed.

Width and height don't really mean anything as they are overridden by the bootstrap aspect ratio class name.

Example use:

Easily embed a YouTube video. Just drop this file in your _plugins directory.

// getRowsData iterates row by row in the input range and returns an array of objects.
// Each object contains all the data for a given row, indexed by its normalized column name.
// Arguments:
// - sheet: the sheet object that contains the data to be processed
// - range: the exact range of cells where the data is stored
// - columnHeadersRowIndex: specifies the row number where the column names are stored.
// This argument is optional and it defaults to the row immediately above range;
// Returns an Array of objects.
function getRowsData(sheet, range, columnHeadersRowIndex) {
columnHeadersRowIndex = columnHeadersRowIndex || range.getRowIndex() - 1;
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
#from clr import AddReference as addr
#addr("Grasshopper")
#from System import Object
#from Grasshopper import DataTree
#from Grasshopper.Kernel.Data import GH_Path
import random