Skip to content

Instantly share code, notes, and snippets.

@ns-1m
ns-1m / Spacedust.dvtcolortheme
Created April 15, 2012 05:59
Spacedust Xcode 4 Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
@ns-1m
ns-1m / django-crossdomainxhr-middleware.py
Created April 15, 2012 07:17 — forked from vicalejuri/django-crossdomainxhr-middleware.py
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
@ns-1m
ns-1m / gist:2403560
Created April 17, 2012 05:02 — forked from geohacker/gist:1605424
mapquest_layer
var map = new L.Map('map');
var mapquestUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png',
subDomains = ['otile1','otile2','otile3','otile4'],
mapquestAttrib = 'Data, imagery and map information provided by <a href="http://open.mapquest.co.uk" target="_blank">MapQuest</a>,
<a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> and contributors.
var mapquest = new L.TileLayer(mapquestUrl, {maxZoom: 18, attribution: mapquestAttrib, subdomains: subDomains});
@ns-1m
ns-1m / gist:2403566
Created April 17, 2012 05:03 — forked from geohacker/gist:1605407
cloudmade_layer
var map = new L.Map('map');
var cloudmadeUrl = 'http://{s}.tile.cloudmade.com/API-KEY/997/256/{z}/{x}/{y}.png',
cloudmadeAttrib = 'Map data &copy; 2011 OpenStreetMap contributors, Imagery &copy; 2011 CloudMade',
cloudmade = new L.TileLayer(cloudmadeUrl, {maxZoom: 18, attribution: cloudmadeAttrib});
@ns-1m
ns-1m / mobile_photo.js
Created April 19, 2012 04:01 — forked from pamelafox/mobile_photo.js
Getting/rotating photos in PhoneGap
function getPhoto(mealId, sourceType, saveOnSuccess) {
var $mealDiv = $('#log-meal-' + mealId);
var $mealImg = $mealDiv.find('.log-meal-photo-button img');
var $quickpicStatus = $('#mobile-quickpic-link span');
function resetQuickPicStatus() {
$quickpicStatus.html('').addClass('icon-camera');
}
@ns-1m
ns-1m / leaflet.google.js
Created April 21, 2012 07:55 — forked from DGuidi/leaflet.google.js
leaflet+google integration
/*
* Here the 'inspiration': http://goo.gl/OKL9A
* Adapted from: http://psha.org.ru/leaflet/Google.js
* Demo: http://psha.org.ru/leaflet/bel.html
* This code works well with jquerymobile:
* the original code maintain a div.height of 0 for the internal google container
* REMARKS: this
* NOTE: jQuery required!
*/
@ns-1m
ns-1m / esrileaf.html
Created April 22, 2012 01:20 — forked from odoe/esrileaf.html
Demo of Backbone.js using ESRI REST in Leaflet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content='text/html, charset=UTF-8' http-equiv='Content-Type' />
<meta content='IE=7,IE=8,IE=9' http-equiv='X-UA-Compatible' />
<meta content='initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' />
<style type="text/css">
@import url("http://code.leafletjs.com/leaflet-0.3.1/leaflet.css");
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@ns-1m
ns-1m / esrileaf.html
Created April 22, 2012 03:40 — forked from odoe/esrileaf.html
Demo of Backbone.js using ESRI REST in Leaflet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta content='text/html, charset=UTF-8' http-equiv='Content-Type' />
<meta content='IE=7,IE=8,IE=9' http-equiv='X-UA-Compatible' />
<meta content='initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport' />
<style type="text/css">
@import url("http://code.leafletjs.com/leaflet-0.3.1/leaflet.css");
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
@ns-1m
ns-1m / geoiq_leaflet.htm
Created April 22, 2012 05:34 — forked from timwaters/geoiq_leaflet.htm
geoiq geocommons and leaflet
<html><head><title>Geocommons and Leaflet JS</title>
<!-- Leaflet CSS -->
<link rel="stylesheet" href="CloudMade-Leaflet-404b097/dist/leaflet.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="CloudMade-Leaflet-404b097/dist>/leaflet.ie.css" /><![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<!-- Leaflet JavaScript -->
<script type="text/javascript" src="CloudMade-Leaflet-404b097/dist/leaflet.js"></script>
@ns-1m
ns-1m / gist:2573378
Created May 2, 2012 03:30
Snippets of OpenLayers.Layer.TMS Offline
tmsLayer = new OpenLayers.Layer.TMS(lay.name,
'Content/outputs/', {
type: 'png',
alpha: true,
serviceVersion: '',
layername: 'Magnetics',
tileExtent: new OpenLayers.Bounds(lay.imageBounds.left,
lay.imageBounds.bottom, lay.imageBounds.right,
lay.imageBounds.top).transform(dproj, proj),
mapMinZoom: lay.imageMinZoom,