Skip to content

Instantly share code, notes, and snippets.

View colemanm's full-sized avatar

Coleman McCormick colemanm

View GitHub Profile
@colemanm
colemanm / x.rb
Created August 29, 2013 21:20
Unrar password protected archives from a txt list of archive files.
#!/usr/bin/env ruby
# Requires the rar utility
# apt-get install rar
# List of filenames to be extracted
l = File.read(ARGV[0])
# Password
p = ARGV[1]
@colemanm
colemanm / sample.vrt
Created August 28, 2013 16:27
VRT file for ogr2ogr
<OGRVRTDataSource>
<OGRVRTLayer name="test">
<SrcDataSource>test.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>WGS84</LayerSRS>
<GeometryField encoding="PointFromColumns" x="Longitude" y="Latitude"/>
</OGRVRTLayer>
</OGRVRTDataSource>
@colemanm
colemanm / map.geojson
Created August 21, 2013 16:06
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@colemanm
colemanm / map.geojson
Created August 20, 2013 21:27
Satellite imagery scenes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
select created_by,count(*) from changes where created_by is not null group by created_by order by count desc
@colemanm
colemanm / qgis_open_photo_action.md
Last active February 3, 2020 20:45
Custom action to link to photos within a GIS feature class.

QGIS Open Image Custom Action

Use this guide to link a path name to a feature's photo in the attribute table.

This assumes you have a column in your data containing the full path to the image you'd like to open (in this example, a field called photo_path).

Create Action

  1. Right click feature class → Properties
  2. On Actions tab:
#!/usr/bin/env ruby
require 'json'
require 'pg'
require 'sequel'
def database
@db ||= Sequel.connect(adapter: 'postgres',
host: 'db.snichaos.com',
user: 'postgres',
img {
max-width: 100%;
height: auto;
}
.right {float:right;}
.left {float:left;}
/* bannerSliders
-------------------------------------------------- */
#!/usr/bin/env ruby
require 'json'
require 'fileutils'
data = JSON.parse(File.read(ARGV[0]))
sorted = JSON.parse(Hash[*data.sort.flatten].to_json)
json = []