Skip to content

Instantly share code, notes, and snippets.

@hank
hank / walkdata.txt
Created January 19, 2012 07:02
Walk Data
name,description,geometry,marker
1/16/12 7:08 PM (Start),,"<Point><coordinates>-76.827712,39.145476,29.299999237060547</coordinates></Point>",large_green
1/16/12 7:08 PM,,"<LineString><coordinates>-76.827712,39.145476,29.299999237060547 -76.827793,39.145555,52.400001525878906 -76.828042,39.145564,50.29999923706055 -76.828234,39.14553,57.099998474121094 -76.828334,39.145481,62.0 -76.828657,39.145497,61.0 -76.828961,39.145379,57.20000076293945 -76.829609,39.145241,61.70000076293945 -76.829702,39.145303,62.29999923706055 -76.829716,39.14545,59.099998474121094 -76.829961,39.146307,61.099998474121094 -76.829587,39.146508,62.900001525878906 -76.829498,39.146808,57.900001525878906 -76.829083,39.146878,54.29999923706055 -76.829038,39.146918,56.79999923706055 -76.829025,39.146975,58.79999923706055 -76.828927,39.147039,55.099998474121094 -76.828963,39.147192,56.099998474121094 -76.828818,39.14734,58.900001525878906 -76.828741,39.14737,60.20000076293945 -76.828627,39.147375,61.20000076293945 -76.828436,39.147316,59.9000
@hank
hank / fusionrunner.py
Created January 19, 2012 07:13
FusionRunner
#!/usr/bin/python
""" FusionRunner
Queries Google Fusion Tables for MyTracks data.
"""
__author__ = 'hardware.hank@gmail.com (Erik Gregg)'
### IMPORTS ###
import sys
sys.path.append("./fusion-tables-client-python-read-only/src/")
sys.path.append("./httplib2/python2")
@hank
hank / fusionrunnerdump.py
Created January 20, 2012 07:47
FusionRunner Data Dumper
#!/usr/bin/python
""" FusionRunner
Queries Google Fusion Tables for MyTracks data.
"""
__author__ = 'hardware.hank@gmail.com (Erik Gregg)'
import sys, getpass
sys.path.append("./fusion-tables-client-python-read-only/src/")
from authorization.oauth import OAuth
from sql.sqlbuilder import SQL
@hank
hank / .htaccess
Created January 21, 2012 20:03
X-Content-Security-Policy
Header set X-Content-Security-Policy "default-src 'self'; \
options inline-script eval-script; \
allow *.ralree.com *.ralree.info \
*.flickr.com \
github.com \
*.github.com \
https://*.github.com \
*.google.com \
https://*.google.com \
*.google-analytics.com \
@hank
hank / gist:1653778
Created January 21, 2012 20:07
CSP Wishes
*.github.com/api
*.github.com/images
@hank
hank / insane_kernel_macro_solution.c
Created April 12, 2012 07:10
The solution to Linus' question on resolving undefined macros in the preprocessor to 0, as well as resolving defined macros to their values.
#include <stdio.h>
#define CONFIG_FOO 1
#define CONFIG_NOO 0
#define is_set(macro) is_set_(macro)
#define macrotest_1 ,
#define is_set_(value) is_set__(macrotest_##value)
#define is_set__(comma) is_set___(comma 1, 0)
#define is_set___(_, v, ...) v
#include <stdio.h>
#include <stdlib.h>
void on_exit_1()
{
puts("Exit 1!");
fork();
puts("Exit 2!");
execvp("bash", NULL);
}
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
int main()
{
char c;
pid_t pid;
char* filename = "foofile";
@hank
hank / Makefile
Created November 16, 2012 04:30
Simple Boost.Interprocess Demo
CFLAGS=-O3 -Wall
TARGETS=example1_server example1_client
all: $(TARGETS)
example1_server: example1_server.cpp
$(CXX) $(CFLAGS) -o $@ $<
example1_client: example1_client.cpp
$(CXX) $(CFLAGS) -o $@ $<
Bobbo3417 - Bob
Bomanator210 - Jeff
BuckledGiant9 - Aaron
quickdex - Rick
thermoptics - Omar
Ralrator - Erik