Skip to content

Instantly share code, notes, and snippets.

View talllguy's full-sized avatar
🎯
Focusing

Elliott Plack talllguy

🎯
Focusing
View GitHub Profile
@Azuritul
Azuritul / .gitignore
Last active June 29, 2024 13:15
General gitignore file sample
# IDEA Ignores #
################
*.iml
*.ipr
*.iws
.idea/
out/
local.properties
# Generic Android ignores #
@zerolab
zerolab / gist:1633661
Created January 18, 2012 15:52
Convert smart quotes with regular ones (and vice-versa)
<?php
//Quotes: Replace smart double quotes with straight double quotes.
//ANSI version for use with 8-bit regex engines and the Windows code page 1252.
preg_replace('[\x84\x93\x94]', '"', $text);
//Quotes: Replace smart double quotes with straight double quotes.
//Unicode version for use with Unicode regex engines.
preg_replace('[\u201C\u201D\u201E\u201F\u2033\u2036]', '"', $text);
@cageyjames
cageyjames / clip.py
Created February 7, 2012 04:12
Clip with ArcPy
import arcpy
from arcpy import env
env.workspace = "c:/workspace"
# variables
in_features = "soils.shp"
clip_features = "study_boundary.shp"
@unapersona
unapersona / transfinish.sh
Created August 10, 2012 09:26
Pushover notification on Transmission file completed
#!/bin/sh
curl -s \
-F "token=APP_TOKEN" \
-F "user=USER_TOKEN" \
-F "title=Download Finished" \
-F "message=$TR_TORRENT_NAME: $TR_TIME_LOCALTIME" \
http://api.pushover.net/1/messages > /dev/null
@calvinmetcalf
calvinmetcalf / streetType.json
Created December 6, 2012 20:42
street types
{
"types":[
"ABBOTTSWOOD",
"ACCESS",
"ACRES",
"AFIELD",
"ALLEY",
"ANNEX",
"APPROACH",
"ARBORWAY",
@nsbingham
nsbingham / tidy-config.txt
Created March 31, 2013 15:56
Clean up a HTML generated by Word with HTML Tidy on OSX
# Install tidy
brew install tidy
# Export the Word doc as HTML
# Create a config file named tidy-config.txt like below
# Find more at http://tidy.sourceforge.net/
tidy -config tidy-config.txt -o cleaned.html -i dirty.htm
@rclark
rclark / L.TopoJSON.js
Last active December 7, 2022 00:23
TopoJSON-aware Leaflet layer
/*
You'll need something like this in your HTML:
<script src="http://d3js.org/topojson.v1.min.js"></script>
*/
L.TopoJSON = L.GeoJSON.extend({
addData: function(jsonData) {
if (jsonData.type === "Topology") {
for (key in jsonData.objects) {
geojson = topojson.feature(jsonData, jsonData.objects[key]);
@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"
}
<?php
header('Content-type: text/plain');
# Grab URL
$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$urlin = curl_exec($ch);
curl_close($ch);
@oconnoat
oconnoat / SimpleHTTPChrome.sh
Created April 18, 2014 09:17
start a python SimpleHTTPServer on port 8000 in this directory and open chrome to the root
python -m SimpleHTTPServer & open -a "Google Chrome" http://localhost:8000