Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Morrison~Westphal ryanttb

View GitHub Profile
View keybase.md

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 Dec 4, 2019
Install node on Linux Subsystem for Windows
View install_node_lsw.sh
#!/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 Aug 29, 2015
Using Thread to help ruby garbage collection
View thread_gc.rb
# 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
Google geocode => OpenLayers Map.setCenter
View gist:975364
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],