Skip to content

Instantly share code, notes, and snippets.

module ActionController
# This module provides a method which will redirect browser to use HTTPS
# protocol. This will ensure that user's sensitive information will be
# transferred safely over the internet. You _should_ always force browser
# to use HTTPS when you're transferring sensitive information such as
# user authentication, account information, or credit card information.
#
# Note that if you are really concerned about your application security,
# you might consider using +config.force_ssl+ in your config file instead.
# That will ensure all the data transferred via HTTPS protocol and prevent
/Users/zacmcc/.vim/
▸ autoload/
▸ backup/
▸ bundle/
▸ colors/
▸ tmp/
"
" Author: Zac McCormick
" https://github.com/zhm/macvimhax
" https://github.com/brentd/vimfiles
"
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
set nocompatible
"
" Author: Zac McCormick
" https://github.com/zhm/macvimhax
" https://github.com/brentd/vimfiles
"
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
set nocompatible
function long2tileX(lon, zoom) {
return Math.floor((lon + 180.0) / 360.0 * Math.pow(2.0, zoom));
}
function lat2tileY(lat, zoom) {
var googleY = Math.floor((1.0 - Math.log(Math.tan(lat * Math.PI/180.0) + 1.0 / Math.cos(lat * Math.PI/180.0)) / Math.PI) / 2.0 * Math.pow(2.0, zoom));
var tmsY = Math.pow(2.0, zoom) - googleY - 1;
return tmsY;
}
@zhm
zhm / RubyMakefile.mk
Created November 30, 2011 05:17
GDAL RubyMakefile for Ruby 1.9.x SWIG bindings
# This makefile generates 4 Ruby extensions - one each for
# gdal, ogr, osr, and gdalconstants. There are two important
# things to note:
#
# * It makes multiple calls to Ruby to discover the Ruby version,
# location of header files, libraries, etc. Thus Ruby must
# be on your path.
#
# * By convention Ruby method names are lower case with underscores,
# thus methods such as "GetFieldName" need to be mapped to
@zhm
zhm / RubyMakefile.mk
Created November 30, 2011 06:11
GDAL RubyMakefile for Ruby 1.9.x SWIG bindings
# This makefile generates 4 Ruby extensions - one each for
# gdal, ogr, osr, and gdalconstants. There are two important
# things to note:
#
# * It makes multiple calls to Ruby to discover the Ruby version,
# location of header files, libraries, etc. Thus Ruby must
# be on your path.
#
# * By convention Ruby method names are lower case with underscores,
# thus methods such as "GetFieldName" need to be mapped to
@zhm
zhm / gdal_ruby.i
Created November 30, 2011 06:17
GDAL Ruby 1.9 fix gdal_ruby.i
/*
* $Id$
*
* ruby specific code for gdal bindings.
*/
/*
* $Log$
* Revision 1.2 2005/09/26 08:18:55 cfis
* Copied over code from the Python version of gdal_ruby.i. Will have to port the code to Ruby.
@zhm
zhm / typemaps_ruby.i
Created November 30, 2011 06:20
GDAL Ruby 1.9 fix typemaps_ruby.i
/******************************************************************************
* $Id$
*
* Name: typemaps_ruby.i
* Project: GDAL Ruby Interface
* Purpose: GDAL Core SWIG Interface declarations.
* Author: Charles F. I. Savage
*
@zhm
zhm / gist:1414632
Created December 1, 2011 07:25
merge GeoJSON quick&dirty
var fs = require('fs');
var files = process.argv.slice(2);
var output = { type: 'LineString', coordinates: [ ] };
for (var i = 0; i < files.length; ++i) {
output.coordinates.append(JSON.parse(fs.readFileSync(files[i])).coordinates);
}
fs.writeFileSync('output.json', JSON.stringify(output, null, '\t'));