Skip to content

Instantly share code, notes, and snippets.

View jsahlen's full-sized avatar

Johan Sahlén jsahlen

  • Oktavilla
  • Stockholm, Sweden
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jsahlen on github.
  • I am jsahlen (https://keybase.io/jsahlen) on keybase.
  • I have a public key ASAPucTPhdQ3aREDBAjqA4iLyJFwybcedUxRXWh17R20sAo

To claim this, I am signing this object:

_homebrew-installed() {
type brew &> /dev/null
}
_nodenv-from-homebrew-installed() {
brew --prefix nodenv &> /dev/null
}
FOUND_NODENV=0
nodenvdirs=("$HOME/.nodenv" "/usr/local/nodenv" "/opt/nodenv" "/usr/local/opt/nodenv")
# Decide prompt color based on host name:
PROMPTCOLOR=$fg_bold[cyan] # Default
case `hostname -s | tr '[:upper:]' '[:lower:]'` in
skoodge) PROMPTCOLOR=$fg_bold[red] ;;
tallest) PROMPTCOLOR=$fg_bold[red] ;;
minimoose) PROMPTCOLOR=$fg_bold[magenta] ;;
mortos) PROMPTCOLOR=$fg_bold[green] ;;
lemongrab) PROMPTCOLOR=$fg_bold[yellow] ;;
esac
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@jsahlen
jsahlen / resources.md
Last active August 29, 2015 14:04
Code resources
@jsahlen
jsahlen / plexconnect.conf
Created August 24, 2013 09:49
Nginx config for PlexConnect running on port 8091
server {
server_name trailers.apple.com atv.plexconnect;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8091;
}
@jsahlen
jsahlen / Gemfile
Created February 14, 2012 15:14
My Guard-based build system for front-end assets – see my blog post at http://monospace.se/posts/guard-build-system
source :rubygems
# V8 JavaScript Engine (for Uglifier)
gem "therubyracer"
# SASS & Compass
gem "sass", "~> 3.2.0.alpha"
gem "compass"
# For concatenation/compression
nameserver 127.0.0.1
port 20560
@jsahlen
jsahlen / gist:833859
Created February 18, 2011 15:58
Reload active Google Chrome tab from MacVim when pressing ⌘R
:nmap <D-r> :!osascript -e 'tell application "Google Chrome" to reload active tab in front window' &<CR>:redraw<CR>
#!/usr/bin/env ruby
URL = "http://store.apple.com/Apple/WebObjects/swedenstore"
down = true
while down
source = `curl -s #{URL}`
throw "connection error" if source.empty?