Skip to content

Instantly share code, notes, and snippets.

View frewsxcv's full-sized avatar
🇵🇸

Corey Farwell frewsxcv

🇵🇸
View GitHub Profile
<html>
<head>
<title>CAL FIRE San Luis Obispo - Project Landing Page</title>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'></script>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.3.0/build/cssreset/reset-min.css">
<link rel='stylesheet' href='style.css' />
<link href="http://fonts.googleapis.com/css?family=Crimson+Text:bold,400italic,600,600italic,700,700italic" rel="stylesheet" type="text/css" >
</head>
<body>
<h1>CAL FIRE San Luis Obispo Current Projects</h1>
@frewsxcv
frewsxcv / nginx config
Created June 9, 2011 18:58
nginx config
server {
server_name cfslo.no-ip.org
location / {
include /etc/nginx/proxy.conf;
proxy_pass http://127.0.0.1:8888;
}
location /incident {
rewrite ^/incident(.+)$ $1 break;
@frewsxcv
frewsxcv / gist:1262533
Created October 4, 2011 19:22
San Luis Obispo translation file (ogr2osm)
def translateAttributes(attrs):
if not attrs:
return
tags = {}
if int(attrs['SPD_PST']) > 0:
tags.update({'maxspeed':attrs['SPD_PST'] + ' mph'})
if attrs['FULLNAME']:
tags.update({'name:fullname':attrs['FULLNAME'] })
@frewsxcv
frewsxcv / gist:1262862
Created October 4, 2011 21:26
San Luis Obispo translation file (ogr2osm)
def translateAttributes(attrs):
if not attrs:
return
tags = {}
if int(attrs['SPD_PST']) > 0:
tags.update({'maxspeed':attrs['SPD_PST'] + ' mph'})
if attrs['FULLNAME']:
tags.update({'name:fullname':attrs['FULLNAME'],'source:maxspeed':'sign' })
@frewsxcv
frewsxcv / testslomapfile
Created January 6, 2012 20:11
test mapfile
MAP
NAME "test"
EXTENT -120.73 35.254 -120.589 35.327
SIZE 800 800
IMAGETYPE png
PROJECTION
"init=epsg:4326"
END
@frewsxcv
frewsxcv / simple_convert_image.sh
Created January 11, 2012 19:34
Taken from ami-07db196e to assist in OpenAerialMap workflow
#!/bin/sh
export GDAL_TIFF_INTERNAL_MASK=YES
nearblack -co TILED=YES -setmask -nb 0 -of GTiff -o ./prewarp.tif $1
gdalwarp -co TILED=YES -dstalpha -t_srs EPSG:4326 prewarp.tif warped.tif
rm prewarp.tif
gdal_translate -co TILED=YES -co JPEG_QUALITY=80 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask 4 warped.tif final.tif
rm warped.tif
gdaladdo final.tif 2 4 8 16 32 64 128 256
mv final.tif ${1}_converted.tif
@frewsxcv
frewsxcv / gist:1628357
Created January 17, 2012 19:33 — forked from oeon/oam.sh
OAM batch script
#!/bin/sh
export GDAL_TIFF_INTERNAL_MASK=YES
for f in /media/LAR_HD/6Inch/*.tif
do
nearblack -co TILED=YES -setmask -nb 0 -of GTiff -o ./prewarp.tif $f
gdalwarp -co TILED=YES -dstalpha -s_srs EPSG:2229 -t_srs EPSG:4326 prewarp.tif warped.tif
rm prewarp.tif
gdal_translate -co TILED=YES -co JPEG_QUALITY=80 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -b 1 -b 2 -b 3 -mask 4 warped.tif final.tif
@frewsxcv
frewsxcv / short-functions.js
Created March 10, 2012 18:01 — forked from dherman/short-functions.js
using -> for concise functions and => for TCP functions
// non-TCP, shorter function
a.some((x) → {
if (invalid(x))
return true;
console.log(x);
})
// maximally concise, implicit return
a.map((x) → x * 17)
@frewsxcv
frewsxcv / short-functions.js
Created March 31, 2012 18:29 — forked from dherman/short-functions.js
using -> for concise functions and → for TCP functions
// 1. Shorter function syntax.
//
// This version does not respect "Tennent's correspondence principle" -- it's nothing
// more than syntactic sugar for the traditional function syntax. That means when you
// see the normal braced body of a function, whether it's a longhand function or this
// shorthand version, there's no difference: return, this, and arguments are all tied
// to the new function body, and there's no implicit returning of the last expression
// result.
a.some((x) → {
var fs = require('fs');
fs.readFile('README.md', (err, data) ⇨ {
if (err) {
console.error("Could not open file: %s", err);
process.exit(1);
}
console.log(data);
});