Skip to content

Instantly share code, notes, and snippets.

View nsbingham's full-sized avatar

Nathan Bingham nsbingham

  • optional
  • United States
View GitHub Profile
@nsbingham
nsbingham / promises-vs-callbacks-example.js
Created September 3, 2013 13:36
A comparison of using wd.js with callbacks versus the promises API
// Example of nesting wd.js callbacks
browser.get("http://admc.io/wd/test-pages/guinea-pig.html", function() {
browser.title(function(err, title) {
assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!');
browser.elementById('i am a link', function(err, el) {
browser.clickElement(el, function() {
browser.eval("window.location.href", function(err, href) {
assert.ok(~href.indexOf('guinea-pig2'));
browser.quit();
});
@nsbingham
nsbingham / A-Pen-by-Nathan-Bingham.markdown
Created October 22, 2013 00:21
A Pen by Nathan Bingham.
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /var/log/nginx/nginx.pid;
events {
worker_connections 1024;
}
@nsbingham
nsbingham / ngrok-with-IISExpress.md
Last active June 27, 2025 20:44
How to get ngrok working with IISExpress/Visual Studio 2013
  1. Decide on a subdomain to use with ngrok. This makes the whole process easier.
  2. Open up a Command Prompt in Administrator mode and run the following command to register the URL with HTTP.sys replacing "modernie" with your subdomain and ##### with your VisualStudio/IISExpress application's port.
netsh add urlacl url=http://modernie.ngrok.com:##### user=everyone
  1. Edit your applicationhost.config. The easiest way to is start up the site and right-click the IISExpress icon in the System Tray. Click "Show All Applications" and select your website running at localhost:#####. Click the path next to "Config" to open the file in an editor.
  2. Search for you site's <bindings> configuration. The easiest way is to search for *:#####:localhost, which should bring you to the <bindings> section for your site. Edit them to include the following:
@nsbingham
nsbingham / A-Pen-by-Nathan-Bingham.markdown
Created March 15, 2014 20:02
A Pen by Nathan Bingham.
Mig Reyes - Web Designer at Basecamp
* Don't be defined by your job title
* Things don't have to be perfect
* Move fast and make ugly things sometimes
Benjamin Dauer - Product Designer NPR
* Working on Pandora for NPR
* The best interfaces are those that you don't notice
* The importance of the human element
@nsbingham
nsbingham / local-dnsserver.md
Last active June 17, 2025 14:52
Testing a CNAME

Setting up a local DNS server with bind on OSX Mavericks

This is really just an approach for locally testing DNS changes, which can easily be done with a HOSTS file if the change involves an IP address, but gets a bit trickier when things like CNAMEs are involved. This is only meant to test locally off a single machine.

  1. Install bind using homebrew

    brew install bind

  2. Follow the installation steps to start up bind

@nsbingham
nsbingham / Rakefile
Created June 30, 2015 15:08
Jekyll/HTML Proofer Rakefile
# https://github.com/gjtorikian/html-proofer
# Add `gem 'html-proofer'` to your Gemfile
# Run `bundle`
# Create a file named `Rakefile`
# Paste the code below in it
# Run `rake test` from the commandline. Issues will be reported.
require 'html/proofer'
task :test do
@nsbingham
nsbingham / header.html
Created July 15, 2015 18:04
Example of active state navigation in Jekyll
<nav class="masthead-nav">
<a class="{% if page.title == "About" %}active {% endif %}tooltipped tooltipped-s" href="{{ site.baseurl }}/about" aria-label="About this site.">About</a>
<a class="{% if page.title == "Process" %}active {% endif %}tooltipped tooltipped-s" href="{{ site.baseurl }}/process" aria-label="Working with us.">Process</a>
<a class="{% if page.title == "Capabilities" %}active {% endif %}tooltipped tooltipped-s" href="{{ site.baseurl }}/capabilities" aria-label="What we can do.">Capabilities</a>
<a class="{% if page.title == "Team Docs" %}active {% endif %}tooltipped tooltipped-s" href="{{ site.baseurl }}/team-docs" aria-label="How we do what we do.">Team Docs</a>
<a class="{% if page.title == "Project Leads" %}active {% endif %}tooltipped tooltipped-s" href="{{ site.baseurl }}/project-leads" aria-label="Who's leading your project?">Project Leads</a>
</nav>