Skip to content

Instantly share code, notes, and snippets.

View ryanttb's full-sized avatar

Ryan Morrison~Westphal ryanttb

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ryanttb on github.
  • I am ryanttb (https://keybase.io/ryanttb) on keybase.
  • I have a public key ASCRNQ4JXIt3D6GbMUtFuaaQENLVbpYSZrIsHkIbMmj2pwo

To claim this, I am signing this object:

@ryanttb
ryanttb / install_node_lsw.sh
Last active December 4, 2019 14:28
Install node on Linux Subsystem for Windows
#!/bin/sh
# this script requires root
# be sure to run the following before running this:
# $ sudo su
# since there's an issue piping the curl response to bash
# just download the install script
curl -sL https://deb.nodesource.com/setup_6.x > install_node.sh
@ryanttb
ryanttb / thread_gc.rb
Last active August 29, 2015 13:58
Using Thread to help ruby garbage collection
# GC.start does not help here, the heap keeps growing
class Foo < ActiveRecord::Base
def self.process_all!
all.each { |record|
puts "Processing #{ record.id }"
record.high_mem_process
record.save!
GC.start
@ryanttb
ryanttb / gist:975364
Created May 16, 2011 21:00
Google geocode => OpenLayers Map.setCenter
function toWebMercator(googLatLng) {
// you'll have to put your conversion code here (not included in this gist)
return { x: googLatLng.lng(), y: googLatLng.lat() };
}
geocoder.geocode({ address: "somewhere" }, function (result, status) {
if (status == google.maps.GeocoderStatus.OK && result.length > 0) {
var
first = result[0],