This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var allPolygons = []; | |
function setPolys(geom) { | |
/* geom: a GeoJSON object. | |
Parse geom, and add it as a child to the global Raphael object, R. | |
*/ | |
//geom.type either Polygon or MultiPolygon | |
var translationFunction = function(coords) { | |
var projected = Projections.contiguous.forward(coords); | |
var x = 217+(projected[0]*190/2400000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements template_preprocess_field(). | |
*/ | |
function THEME_preprocess_field(&$vars) { | |
// If the view mode is "full" use <h2> for the field labels. Otherwise, | |
// assume a teaser or more compact view mode is being displayed, and use <h3>. | |
$vars['heading'] = ($vars['element']['#view_mode'] == 'full') ? 'h2' : 'h3'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************** | |
* OSM2GEO - OSM to GeoJSON converter | |
* OSM to GeoJSON converter takes in a .osm XML file as input and produces | |
* corresponding GeoJSON object. | |
* | |
* AUTHOR: P.Arunmozhi <[email protected]> | |
* DATE : 26 / Nov / 2011 | |
* LICENSE : WTFPL - Do What The Fuck You Want To Public License | |
* LICENSE URL: http://sam.zoy.org/wtfpl/ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(k) { | |
var Button = function(a, x, y) { | |
this.initialize(a,x,y) | |
},p = Button.prototype = new DisplayObject; | |
p.left = 0; | |
p.top = 0; | |
p.ypos = 0; | |
p.image = null; | |
p.snapToPixel = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/* | |
* Parsing BIG compressed data with Node.js and SAX | |
* Probably some bugs, but worked fine for OpenStreetMap Great Britain bz2 | |
* Greg Miell 2012 | |
*/ | |
// Simple string trim prototype extension | |
String.prototype.trim = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>D3 + Leaflet (fork from bost.ocks.org/mike/leaflet/)</title> | |
<style> | |
#map { width: 960px; height: 500px;} | |
path { fill: #000; fill-opacity: .2; stroke: #fff; stroke-width: 1.5px;} | |
path:hover { fill: brown;fill-opacity: .7;} | |
</style> | |
<p id="map"><p> | |
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script> | |
<script src="leaflet.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* User Profile2 MYPROFILE2TYPE. | |
*/ | |
/** | |
* Page callback for user profile2 MYPROFILE2TYPE form. | |
*/ | |
function MYMODULE_load_profile2_MYPROFILE2TYPE_form($form, &$form_state, $user = NULL) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import uuid | |
import os | |
from zipfile import ZipFile, is_zipfile | |
import sys | |
import time | |
from random import randint | |
import argparse | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bip39 = require("bip39"); | |
var ethwallet = require('ethereumjs-wallet'); | |
var ProviderEngine = require("web3-provider-engine"); | |
var WalletSubprovider = require('web3-provider-engine/subproviders/wallet.js'); | |
var Web3Subprovider = require("web3-provider-engine/subproviders/web3.js"); | |
var Web3 = require("web3"); | |
// Insert raw hex private key here, e.g. using MyEtherWallet | |
var wallet = ethwallet.fromPrivateKey(Buffer.from('abcdef', 'hex')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
from collections import OrderedDict | |
from itertools import count | |
# precision of output points | |
decimals = 2 | |
svg = '''M0,0 L66,0 L66,140 L0,140 L0,0 Z M17.5356193,9.91374504 L7.89629934,9.91374504 L7.89629934,34.6390567 L13.9842872,34.6390567 L13.9842872,27.741635 L17.6136633,27.741635 C21.6461094,27.741635 24.6445573,27.0341777 26.6090071,25.619263 C28.5734569,24.2043483 29.555612,21.9699927 29.5554723,18.9161962 C29.5554723,15.8625389 28.5993435,13.5986987 26.687086,12.1246754 C24.7748285,10.6511862 21.7243396,9.91420937 17.5356193,9.91374504 Z M51.2530562,20.2426569 L40.4040722,20.2426569 L40.4040722,9.91374504 L34.3159446,9.91374504 L34.3159446,34.6392308 L40.4040722,34.6390567 L40.4040722,24.9118057 L51.2530562,24.9118057 L51.2530562,34.6392308 L57.3411838,34.6392308 L57.3411838,9.91374504 L51.2530562,9.91391916 L51.2530562,20.2426569 Z''' | |
def string_to_point_tuple(s): |
OlderNewer