Skip to content

Instantly share code, notes, and snippets.

@ericrallen
Last active December 25, 2015 03:18

Revisions

  1. Eric Allen revised this gist Jan 30, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion xip.io.scpt
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,11 @@ on run argv
    set currentDir to do shell script "echo ${PWD##*/}"

    -- set url
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io" & item 1 of argv
    if (count of argv) > 0 then
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io" & item 1 of argv
    else
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io"
    end if

    -- add url to clipboard
    set the clipboard to urlString
  2. Eric Allen revised this gist Jan 30, 2015. 1 changed file with 28 additions and 16 deletions.
    44 changes: 28 additions & 16 deletions xip.io.scpt
    Original file line number Diff line number Diff line change
    @@ -1,23 +1,35 @@
    -- generates xip.io url
    -- I store this script in my ~/Sites directory and then use `ln -s ~/Sites/xip.io.scpt` in Terminal to create a symbolic link in the folder for my site
    -- add this alias to your .bash_profile or .bashrc for quickly using it via Terminal: `alias xipit='osascript xip.io.scpt'`
    -- generates xip.io url with optional port
    -- I store this script in my ~/bin directory and then use `ln -s ~/bin/xip.io.scpt` to create a symbolic link in the folder for my current project

    --ALFRED USERS: Here's an Alfred workflow based off this AppleScript: http://cl.ly/3I28263K3k3t (author's Twitter handle: @DanPhilibin)
    -- Here's the funciton in my ~/.bashrc file:
    -- function xipit() {
    -- port=$@
    -- if [ ! -f xip.io.scpt ]; then
    -- ln -s ~/bin/xip.io.scpt;
    -- fi
    -- osascript xip.io.scpt $port;
    -- }

    -- get IP address
    set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"
    -- call it like this `xipit :3000` to get an xip.io URL with the port set to 3000

    if(tIP is "") then
    set tIP to do shell script "ifconfig en1|grep 'inet '|cut -d ' ' -f 2"
    end if
    --ALFRED USERS: Here's an Alfred workflow based off the previous version of this AppleScript: http://cl.ly/3I28263K3k3t (author's Twitter handle: @DanPhilibin)

    -- get current directory
    set currentDir to do shell script "echo ${PWD##*/}"
    on run argv
    -- get IP address
    set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"

    -- set url
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io"
    if(tIP is "") then
    set tIP to do shell script "ifconfig en1|grep 'inet '|cut -d ' ' -f 2"
    end if

    -- add url to clipboard
    set the clipboard to urlString
    -- get current directory
    set currentDir to do shell script "echo ${PWD##*/}"

    do shell script "echo " & urlString
    -- set url
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io" & item 1 of argv

    -- add url to clipboard
    set the clipboard to urlString

    do shell script "echo " & urlString
    end run
  3. ericrallen revised this gist Oct 24, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions xip.io.scpt
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,8 @@
    -- I store this script in my ~/Sites directory and then use `ln -s ~/Sites/xip.io.scpt` in Terminal to create a symbolic link in the folder for my site
    -- add this alias to your .bash_profile or .bashrc for quickly using it via Terminal: `alias xipit='osascript xip.io.scpt'`

    --ALFRED USERS: Here's an Alfred workflow based off this AppleScript: http://cl.ly/3I28263K3k3t (author's Twitter handle: @DanPhilibin)

    -- get IP address
    set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"

  4. ericrallen revised this gist Oct 9, 2013. 1 changed file with 8 additions and 2 deletions.
    10 changes: 8 additions & 2 deletions xip.io.scpt
    Original file line number Diff line number Diff line change
    @@ -5,11 +5,17 @@
    -- get IP address
    set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"

    if(tIP is "") then
    set tIP to do shell script "ifconfig en1|grep 'inet '|cut -d ' ' -f 2"
    end if

    -- get current directory
    set currentDir to (container of (path to me))
    set currentDir to do shell script "echo ${PWD##*/}"

    -- set url
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io"

    -- add url to clipboard
    set the clipboard to urlString
    set the clipboard to urlString

    do shell script "echo " & urlString
  5. Eric Allen created this gist Oct 9, 2013.
    15 changes: 15 additions & 0 deletions xip.io.scpt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    -- generates xip.io url
    -- I store this script in my ~/Sites directory and then use `ln -s ~/Sites/xip.io.scpt` in Terminal to create a symbolic link in the folder for my site
    -- add this alias to your .bash_profile or .bashrc for quickly using it via Terminal: `alias xipit='osascript xip.io.scpt'`

    -- get IP address
    set tIP to do shell script "ifconfig en0|grep 'inet '|cut -d ' ' -f 2"

    -- get current directory
    set currentDir to (container of (path to me))

    -- set url
    set urlString to "http://" & currentDir & "." & tIP & ".xip.io"

    -- add url to clipboard
    set the clipboard to urlString