Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 7, 2024 01:38
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@jacobandresen
jacobandresen / gist:836127
Created February 20, 2011 17:28
nonimatim openlayers jquery example
$(function() {
var geoCodeURL = "http://nominatim.openstreetmap.org/search";
var map = new OpenLayers.Map({ div: "map" });
var osm = new OpenLayers.Layer.OSM();
map.addLayers([osm]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.setCenter(
new OpenLayers.LonLat( 9.2134, 55.3028).transform(
new OpenLayers.Projection("EPSG:4326"),
map.getProjectionObject()
@tmcw
tmcw / modestmaps-tiling.py
Created December 4, 2012 00:05
ModestMaps-py Tiling with MapBox
# Requires ModestMaps to be installed
# Don't do this unless you have a very good reason, and a MapBox account,
# and you replace the 'examples' tileset with a tileset in your account.
import ModestMaps as MM
from ModestMaps.Geo import MercatorProjection, deriveTransformation
from ModestMaps.Providers import IMapProvider
from math import pi
class MapBox(IMapProvider):
@bmcbride
bmcbride / LeafletToWKT.js
Last active June 7, 2022 02:17
Leaflet layer to WKT
function toWKT(layer) {
var lng, lat, coords = [];
if (layer instanceof L.Polygon || layer instanceof L.Polyline) {
var latlngs = layer.getLatLngs();
for (var i = 0; i < latlngs.length; i++) {
latlngs[i]
coords.push(latlngs[i].lng + " " + latlngs[i].lat);
if (i === 0) {
lng = latlngs[i].lng;
lat = latlngs[i].lat;
@tmcw
tmcw / ajax_for_cats.md
Last active April 19, 2021 21:08
AJAX for Cats

AJAX For Cats

I will assume that you are familiar with Javascript and HTML - read up on jsforcats.com if you need Javascript chops, and Learn HTML for HTML.

AJAX is a feature of Javascript and your browser that downloads new data after you initially request a page: so you live-update content and pull in new bits of content a user requests. AJAX is how the Pinterest home page keeps loading content when you scroll, and it's how Gmail can ring in new emails without requiring you to click 'refresh' all the time.

Let's clear things up. Like Javascript for Cats, it's best to use Google Chrome for this, and to use your web developer extensions.

Requests

@caseycesari
caseycesari / avi-map-sql.md
Last active December 14, 2015 14:29
The SQL for creating a parcel layer simliar to the one that powers http://apps.axisphilly.org/avi-map

These commands are all run within the psql command line tool.

Create table for tax year 2013 data

CREATE TABLE tx_2013 (
  Acct_Num varchar(9),
  Address text,
  Unit text,
  Homestd_Ex text,

Prop_Cat text,

@benbalter
benbalter / geojson-conversion.sh
Last active April 23, 2024 13:16
Bulk convert shapefiles to geojson using ogr2ogr
# Bulk convert shapefiles to geojson using ogr2ogr
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/
# Note: Assumes you're in a folder with one or more zip files containing shape files
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere)
#geojson conversion
function shp2geojson() {
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp"
}
@kerryrodden
kerryrodden / .block
Last active April 22, 2024 19:24
Sequences sunburst
license: apache-2.0
-- Census tract population is column dp0010001
WITH op AS
(SELECT the_geom,
cartodb_id,
dp0010001,
Row_number() OVER (
ORDER BY Cdb_latlng(/* Starting latitude */, /* Starting longitude */) <-> the_geom) AS row_number
FROM /* Table name */ LIMIT /* Max census tracts queryable */),
sm AS
@officeofjane
officeofjane / README.md
Last active December 17, 2017 18:04
Small multiple bar charts with tooltips