Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘

Alex Yule yuletide

🤘
View GitHub Profile
@yuletide
yuletide / index.html
Last active May 29, 2020
Mapbox Swap Studio Source for GeoJSON
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Swap Studio Source for GeoJSON</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="shortcut icon"
href="https://static-assets.mapbox.com/branding/favicon/v1/favicon.ico"
type="image/x-icon"
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title></title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.css' rel='stylesheet' />
<script src='http://mapbox-gl-inspect.lukasmartinelli.ch/dist/mapbox-gl-inspect.min.js'></script>
<link href='http://mapbox-gl-inspect.lukasmartinelli.ch/dist/mapbox-gl-inspect.css' rel='stylesheet' />
View overpass_34.77420,32.01895.json
{
"version": 0.6,
"generator": "Overpass API 0.7.54.12 054bb0bb",
"osm3s": {
"timestamp_osm_base": "2018-01-09T23:33:02Z",
"timestamp_areas_base": "2018-01-09T23:09:02Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [
{
View .vimrc
" vim-plug
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
if !has('nvim')
call plug#begin('~/.vim/plugged')
else
call plug#begin('~/.local/share/nvim/plugged')
endif
@yuletide
yuletide / helpers.py
Created Oct 26, 2012 — forked from pwfff/helpers.py
coursera neural networks assignment 1 sample code (ported from octave)
View helpers.py
import scipy.io
UNWANTED_KEYS = ('__globals__', '__header__', '__version__')
def load_dataset(path):
data = scipy.io.loadmat(path)
for key in UNWANTED_KEYS:
del data[key]
@yuletide
yuletide / get_defs.php
Created Oct 18, 2012
EPSG postgis scraper
View get_defs.php
<?php
/* from http://lists.osgeo.org/pipermail/openlayers-users/2010-June/017976.html */
$conn_string = "host=localhost port=5432
dbname=mydatabase_with_postgis_activated user=my_user password=my_password";
$link = pg_connect($conn_string) or die("Could not connect");
$start_epsg = 'Proj4js.defs["EPSG:';
$end_epsg_start_proj4js = '"] = "';
$end_proj4js ='";';
@yuletide
yuletide / epsg.js
Created Oct 18, 2012
Proj4js EPSG Definitions as a node module
View epsg.js
module.exports = function(Proj4js){
Proj4js.defs["EPSG:3819"] = "+proj=longlat +ellps=bessel +towgs84=595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408 +no_defs";
Proj4js.defs["EPSG:3821"] = "+proj=longlat +ellps=aust_SA +no_defs";
Proj4js.defs["EPSG:3824"] = "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs";
Proj4js.defs["EPSG:3889"] = "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs";
Proj4js.defs["EPSG:3906"] = "+proj=longlat +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +no_defs";
Proj4js.defs["EPSG:4001"] = "+proj=longlat +ellps=airy +no_defs";
Proj4js.defs["EPSG:4002"] = "+proj=longlat +ellps=mod_airy +no_defs";
Proj4js.defs["EPSG:4003"] = "+proj=longlat +ellps=aust_SA +no_defs";
Proj4js.defs["EPSG:4004"] = "+proj=longlat +ellps=bessel +no_defs";
@yuletide
yuletide / gist:3741017
Created Sep 18, 2012
action_mailer local dev settings
View gist:3741017
# config/environments/development.rb
# current setting -- saves sent mails locally in rails_root/tmp/mails/
config.action_mailer.delivery_method = :file
# OR...
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
View gist:2933510
library(ggplot2)
library(RJSONIO)
library(foreign)
input_dir = "~/data/twitter-workshop/input/"
snow = read.csv(paste0(input_dir, "snow_pot.csv"))
props = read.dbf(paste0(input_dir, "SecondAuctionProperties.dbf"))
# Note: Need to remove a leading '\' from the MenByTract file before it will load
@yuletide
yuletide / hack.sh
Created Apr 8, 2012 — forked from erikh/hack.sh
OSX For Hackers
View hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#