Skip to content

Instantly share code, notes, and snippets.

View RandomEtc's full-sized avatar
🦕

Tom Carden RandomEtc

🦕
View GitHub Profile
@RandomEtc
RandomEtc / Procfile
Created September 26, 2011 15:59
Getting Kue working on Heroku
web: node app.js
worker: node consumer.js
@RandomEtc
RandomEtc / README.md
Created September 22, 2011 02:41
Map Tiles in D3

An exercise in learning D3 / a proof of concept / my hat-in-the-ring for what comes next after Polymaps and Modest Maps. See the github project page for more information.

@RandomEtc
RandomEtc / 1-make-key
Created September 16, 2011 16:35
generating SSL keys and Certificate Signing Requests for Heroku / Nginx / RapidSSL
Key was generated using:
tom% openssl genrsa -des3 -out example.com.key 2048
Generating RSA private key, 2048 bit long modulus
....+++
..........................................................................................................................+++
e is 65537 (0x10001)
Enter pass phrase for example.com.key:
Verifying - Enter pass phrase for example.com.key:
%tom
@RandomEtc
RandomEtc / mongo_import.js
Created September 15, 2011 16:04
use node.js to copy from one mongo db to another
var url = require('url'),
mongodb = require('mongodb');
var sourceUrl = 'mongodb://user:pass@host:port/db',
targetUrl = 'mongodb://user:pass@host:port/db',
collectionName = 'my_awesome_collection';
function openDbFromUrl(mongoUrl, cb) {
var dbUrl = url.parse(mongoUrl),
dbName = dbUrl.pathname.slice(1), // no slash
@RandomEtc
RandomEtc / conversion.sh
Created September 13, 2011 04:00
conversion loops in bash
# to make a folder full of animated gifs into a folder full of vertical frames
# (brew install imagemagick)
for i in *.gif;do echo $i
convert "$i" "`echo $i | sed -e 's/\.gif//g'`%02d.gif"
convert "`echo $i | sed -e 's/\.gif//g'`*.gif" -append $i
done
# to make a folder full of html into a folder full of pdfs
# (brew install wkhtml2pdf)
@RandomEtc
RandomEtc / index.html
Last active September 26, 2015 23:47
Modest Maps Throwable
<!DOCTYPE html>
<html>
<head>
<title>Modest Maps JS - Throwable Test</title>
<script type="text/javascript" src="modestmaps.min.js"></script>
<script type="text/javascript">
(function(MM){
MM.ThrowableHandler = function() { }
@RandomEtc
RandomEtc / modestmaps-static.js
Created August 23, 2011 06:52
Node.js server for composing map tiles using modestmaps.js
var MM = require('modestmaps'),
Canvas = require('canvas'),
Image = Canvas.Image;
get = require('get'),
express = require('express');
function renderStaticMap(provider, dimensions, zoom, location, callback) {
var canvas = new Canvas(dimensions.x, dimensions.y),
ctx = canvas.getContext('2d');
@RandomEtc
RandomEtc / KeyEvent.h
Created August 16, 2011 02:27
Cinder's KeyEvent.h modified to hold a std::string (UTF8) rather than a char (ASCII)
/*
Copyright (c) 2010, The Barbarian Group
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that
the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
@RandomEtc
RandomEtc / TextField.h
Created August 9, 2011 23:53
UITextField wrapper for Cinder
//
// TextField.h
//
// Created by Tom Carden on 8/9/11.
// Copyright 2011 Bloom Studio, Inc. All rights reserved.
//
#pragma once
#include <string>
@RandomEtc
RandomEtc / OpenStreetMapProvider.pde
Created March 5, 2011 00:18
A Modest Maps provider for OpenStreetMap in Processing
import processing.core.*;
import com.modestmaps.core.*;
import com.modestmaps.geo.*;
public class OpenStreetMapProvider extends AbstractMapProvider {
public String[] subdomains = new String[] { "", "a.", "b.", "c." };
public OpenStreetMapProvider() {