Skip to content

Instantly share code, notes, and snippets.

@ijonas
Created August 14, 2012 11:17
Show Gist options
  • Select an option

  • Save ijonas/3348285 to your computer and use it in GitHub Desktop.

Select an option

Save ijonas/3348285 to your computer and use it in GitHub Desktop.
Generate xip.io URLs for your pow.cx enabled Rails applications
#! /usr/bin/env ruby
local_ip = `ifconfig en0`.match(/inet (\d+\.\d+\.\d+\.\d+)/)[1]
appname = Dir.getwd[/(\w+)\z/]
puts "http://#{appname}.#{local_ip}.xip.io"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment