Skip to content

Instantly share code, notes, and snippets.

View seanknox's full-sized avatar
🙋‍♂️

Sean Knox seanknox

🙋‍♂️
  • San Francisco, CA
View GitHub Profile
@seanknox
seanknox / npm.sublime-build
Created October 27, 2015 21:37
NPM test build definition for Sublime Text 3
{
"cmd": ["npm", "test"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"working_dir": "$project_path"
}
verify_plugin_signatures: false
# We ignore the following git hooks provided by overcommit for now
PostCheckout:
ALL:
enabled: false
CommitMsg:
ALL:
enabled: false

Keybase proof

I hereby claim:

  • I am seanknox on github.
  • I am seanknox (https://keybase.io/seanknox) on keybase.
  • I have a public key whose fingerprint is B019 6296 2D40 9761 2660 D94D 183B D9EF C042 DB7E

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am seanknox on github.
* I am seanknox (https://keybase.io/seanknox) on keybase.
* I have a public key whose fingerprint is F188 A721 E4A5 399E 4F2B CE49 33BF 9F24 16C4 0662
To claim this, I am signing this object:
@seanknox
seanknox / spec--capybara_helpers.rb
Created May 10, 2014 03:01
RSpec + Capybara + Sauce Labs + Selenium (local or remote)
module CapybaraHelpers
class << self
def local_ip
ipv4_addr_info.ip_address
end
def setup_selenium_remote
app_host ||= ENV.fetch('SELENIUM_APP_HOST', local_ip)
Capybara.server_host = app_host
Capybara.app_host = "http://#{app_host}:#{Capybara.current_session.server.port}"
@seanknox
seanknox / gist:10688629
Created April 14, 2014 22:58
Fix for ruby with Xcode 5.1
82c82
< CONFIG["LIBRUBY_DLDFLAGS"] = "-undefineddynamic_lookup -multiply_definedsuppress -install_name $(libdir)/$(LIBRUBY_SO) -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(ruby_version) $(XLDFLAGS)"
---
> CONFIG["LIBRUBY_DLDFLAGS"] = "-undefineddynamic_lookup -multiply_defined suppress -install_name $(libdir)/$(LIBRUBY_SO) -current_version $(MAJOR).$(MINOR).$(TEENY) -compatibility_version $(ruby_version) $(XLDFLAGS)"
125c125
< CONFIG["DLDFLAGS"] = "-undefineddynamic_lookup -multiply_definedsuppress"
---
> CONFIG["DLDFLAGS"] = "-undefineddynamic_lookup -multiply_defined suppress"
$ tree /Library/Developer/CommandLineTools
/Library/Developer/CommandLineTools
├── Library
│   ├── Developer
│   │   └── Acknowledgments.pdf
│   ├── Perl
│   │   ├── 5.12
│   │   │   └── darwin-thread-multi-2level
│   │   │   ├── SVN
│   │   │   │   ├── Base.pm
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]> ><! <![endif]-->
<html class='no-js' lang='en'>
<!-- <![endif] -->
<head>
<meta charset='utf-8'>
@seanknox
seanknox / gist:4180951
Created December 1, 2012 07:21
How to route multipoint addresses + pub transit
We have code that takes an array of addresses and then determines routes between them using the Google Maps API, all in Javascript. It works roughly like this:
var eventArray = ["1062 W. Webster Avenue", "222 Merchandise Mart Plaza", "Midway International Airport"]
var directions = [];
while (eventArray.length > 1) { // Stop running when we have less than two addresses to route btwn
var start = eventArray[0]; // start is the first address in our array
var end = eventArray[1]; // end is the next address in the array
@seanknox
seanknox / index.html
Created November 13, 2012 01:46
HTML code for HTML5 geolocation + Leaflet/OpenStreetMaps
<div style="width:800px; height:500px" id="map"></div>
<script type='text/javascript'>
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position){
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
});