Skip to content

Instantly share code, notes, and snippets.

@jayzeng
jayzeng / process.py
Created August 15, 2011 02:34
Intelius Xml and php config class processor
#!/usr/bin/python -tt
# @author Jay Zeng
# @since 8/14/2011
# Utility to dynamically re-construct file
#
# Input -> output:
# summary_intelius-2011-06-07_m27744-three-headlines-good-news-null.xml -> summary_m27744-three-headlines-good-news-null.xml
# class
# change file name and class name
var require, define;
(function () {
function getInteractiveScript() {
var a, b, c;
if (interactiveScript && interactiveScript.readyState === "interactive") return interactiveScript;
a = document.getElementsByTagName("script");
for (b = a.length - 1; b > -1 && (c = a[b]); b--) if (c.readyState === "interactive") return interactiveScript = c;
return null
}
function newContext(contextName) {
@jayzeng
jayzeng / gist:883776
Created March 23, 2011 19:33
bing map
window.Microsoft = window.Microsoft || {};
window.Microsoft.Maps = window.Microsoft.Maps || {};
window.Microsoft.Maps.initMapDelayCode = function () {
var K = 'Invalid Credentials. Sign up for a developer account at: <a href="http://www.microsoft.com/maps/developers">http://www.microsoft.com/maps/developers</a>',
M = "{num} km",
Y = "{num} m",
ab = "{num} miles",
bb = "{num} yds",
db = "{num} feet",
X = "Click to pan in any direction",
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=en" type="text/javascript" charset="UTF-8"></script>
</head>
<body onload="init();">
<div id="myMap" style="position: relative; width: 600px; height: 450px;"></div>
@jayzeng
jayzeng / bingMap.js
Created March 17, 2011 17:38
Displays a series pins with an index number and set a central point base upon all pins
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.pushpin {position: absolute; text-align: center; width: 100%; font: normal normal bold 10pt/normal Arial, Helvetica, sans-serif; color: rgb(255, 255, 255); left: 0px; top: 5px;}
</style>
<script src="http://prototypejs.org/assets/2009/8/31/prototype.js"></script>
<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&s=1"></script>
<script>