Skip to content

Instantly share code, notes, and snippets.

@meshulam
meshulam / zimbra.txt
Last active December 11, 2015 18:39
This bookmarklet recites the current URL as Dadaist sound poetry. It just removes all non-letters from the URL and passes it to the Google Translate text-to-speech service in Italian mode (it's funniest that way). It doesn't work on all sites, probably because of some sort of cross-site referral limitations on Google's part. Tested in Safari and…
javascript:(function(){ var s=location.href.replace(/[^A-Za-z]/g,'');var url='http://translate.google.com/translate_tts?ie=UTF-8&tl=it&q='+s; console.log(url); var a=document.createElement('audio');a.setAttribute('src',url);a.play();}())
import datetime
import dateutil.parser
import optparse
from Queue import Queue
import tempodb
from threading import Thread
class Worker(Thread):
"""Thread executing tasks from a given tasks queue"""
def __init__(self, tasks):
@meshulam
meshulam / tempodb-export.py
Last active August 29, 2015 14:01
Export script for TempoDB
# Script to export TempoDB data.
# Relies on TempoDB python client v1.0: https://github.com/tempodb/tempodb-python/tree/v1.0
import datetime
import os
import re
import json
import uuid
from tempodb.client import Client
import dateutil.parser
import optparse
from Queue import Queue
from tempodb.client import Client
from tempodb.protocol import DataPoint
from threading import Thread
class Worker(Thread):
"""Thread executing tasks from a given tasks queue"""
@meshulam
meshulam / blender_shortcuts.rst
Last active August 29, 2015 14:19
Blender Shortcuts

Blender Shortcut Cheatsheet

Navigation:

  • Rotate - MMB-drag
  • Pan - Shift-MMB-drag
  • Zoom - Wheel or Ctrl-MMB-drag

Numpad navigation:

@meshulam
meshulam / event-replay.py
Created November 19, 2015 16:56
Replay JSON events from a file into TempoIQ
import base64
import argparse
import httplib
import os
import sys
import time
# run 'python event-replay.py -h' to see usage.
# set default environment info here if you don't want to put it on the command
int numSends; // counter to count number of sends to Cloud
void setup() {
// put your setup code here, to run once:
SerialCloud.begin(115200);
SerialUSB.begin(9600);
SerialUSB.println("Hello Cloud example has started...");
numSends = 0; // count number of sends
}
@meshulam
meshulam / json-table-transform.js
Created September 26, 2016 16:39
Transform an array-of-arrays style JSON table file (with header row) into an array-of-objects format
'use strict';
const fs = require('fs');
const files = process.argv.slice(2);
function transformRow(row, headers) {
let outObj = {};
for (let i=0; i<headers.length; i++) {
outObj[headers[i]] = row[i];
}
@meshulam
meshulam / apiarytest.html
Created January 4, 2017 21:27
Isolated test showing iOS display issues with embedded apiary docs
<!doctype html>
<html>
<head>
<title>Apiary test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { margin: 0; }
.header,
@meshulam
meshulam / cjp-article.html
Created June 28, 2017 01:18
Example article for creating interactive location info UI
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Chicago Justice Project - Data portal</title>
<link href="http://data.chicagojustice.org/site.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="http://data.chicagojustice.org/css/custom-theme/jquery-ui-1.8.15.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="http://data.chicagojustice.org/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="http://data.chicagojustice.org/js/jquery-ui-1.8.15.custom.min.js"></script>