Skip to content

Instantly share code, notes, and snippets.

View yuletide's full-sized avatar
🤘

Alex Yule yuletide

🤘
View GitHub Profile
@yuletide
yuletide / howtocontribute.md
Created December 16, 2011 19:08
How to Contribute
  1. Fork it.
  2. Create a branch (git checkout -b my_markup)
  3. Commit your changes (git commit -am "Added Snarkdown")
  4. Push to the branch (git push origin my_markup)
  5. Create an Issue with a link to your branch
  6. Enjoy a refreshing Diet Coke and wait
@yuletide
yuletide / hack.sh
Created April 8, 2012 01:28 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#
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 / gist:3741017
Created September 18, 2012 03:09
action_mailer local dev settings
# 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",
@yuletide
yuletide / epsg.js
Created October 18, 2012 01:22
Proj4js EPSG Definitions as a node module
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 / get_defs.php
Last active January 19, 2023 17:29
EPSG postgis scraper for `node-proj4js-defs`
<?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 / helpers.py
Created October 26, 2012 04:38 — forked from pwfff/helpers.py
coursera neural networks assignment 1 sample code (ported from octave)
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]
" 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
{
"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": [
{
<!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' />