Skip to content

Instantly share code, notes, and snippets.

@feesta
feesta / random-tile.cgi
Created August 7, 2012 22:05
Loads random tiles in the US with links to slippy maps at that location.
#!/usr/bin/env python
import cgi
import ModestMaps
import random
print "Content-type: text/html"
print
print """
<style>
@feesta
feesta / .vimrc
Created October 2, 2012 16:41
Basic vimrc
set nocompatible
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set expandtab
set showmatch
@feesta
feesta / nginx.conf
Created October 2, 2012 16:43
Nginx config to forward traffic to a port.
user www-data;
worker_processes 5;
worker_rlimit_nofile 8192;
events {
worker_connections 4096;
}
http {
server {
@feesta
feesta / app.js
Created October 3, 2012 17:00
A basic NodeJS/Socket.IO chatroom
var express = require("express"),
http = require("http");
var app = express();
var server = http.createServer(app);
var io = require("socket.io").listen(server);
server.listen(80);
app.get("/", function (req, res) {
@feesta
feesta / compass.html
Created November 13, 2012 17:27
A compass showing points and their distances from the current location. Pass points in using the URL.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width initial-scale=1.0 user-scalable=no minimum-scale=1.0 maximum-scale=1.0" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<!--<script type="text/javascript" src="kinetic-v4.0.4.min.js"></script>-->
<script type="text/javascript">
@feesta
feesta / OSX Scripts
Created November 14, 2012 02:00
Notes for OSX
// change destination for screenshots
defaults write com.apple.screencapture location /Users/feesta/Sites/Screenshots/
// loads changes immediately eliminating need to logout/login.
killall SystemUIServer –
// Don't ask when executing downloaded files. Use with care!
defaults write com.apple.LaunchServices LSQuarantine -bool NO
@feesta
feesta / mylibrary-jquery.js
Created May 23, 2013 01:05
Template for a namespaced jQuery library with it's own classes.
// DummyConsole.js
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{});
if (typeof MINE === "undefined") MINE = {};
var options = {};
jQuery(function() {
M = new MINE.MyLibrary(options);
});
@feesta
feesta / device.txt
Last active December 18, 2015 10:39
Hello World for Max72xx and a 4 digit 7-segment display (Electric Imp device code)
// Hello World for Max72xx and a 4 digit 7-segment display (Electric Imp device code)
hardware.pin7.configure(DIGITAL_OUT);
hardware.spi189.configure(SIMPLEX_TX, 10000);
function send(data) {
hardware.pin7.write(0); // set CS before sending data
hardware.spi189.write(data);
hardware.pin7.write(1); // release CS after sending data
}
@feesta
feesta / bmp180.device.nut
Last active October 4, 2015 22:10 — forked from smittytone/bmp180.device.nut
Adding default i2c_address_7_bit of 0x77
class BMP180_Sensor
{
// Squirrel Class for Bosch BMP180 Temperature and Pressure Sensor
// [http://www.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf]
// As used on the Adafruit BMP180 breakout board
// [http://www.adafruit.com/products/1603]
// Bus: I2C
// Note: current version only accounts for an oversampling_setting = 0
{
"workbench.colorTheme": "Visual Studio Light",
"workbench.colorCustomizations": {
"titleBar.activeForeground":"#ffffff",
"titleBar.activeBackground":"#968c82",
"titleBar.inactiveForeground":"#888",
"titleBar.inactiveBackground": "#cbbfb1",
"window.activeBorder":"#000",
"window.inactiveBorder":"#666",