Skip to content

Instantly share code, notes, and snippets.

View terlar's full-sized avatar

Terje Larsen terlar

View GitHub Profile
@terlar
terlar / gist:3689896
Created September 10, 2012 09:27
Gemfile tools
# Method for finding a file within a project
_file-within-project() {
local file=$1
local check_dir=$PWD
while [ $check_dir != "/" ]; do
if [ -f "$check_dir/$file" ]; then
echo "$check_dir/$file"
return true
fi
check_dir="$(dirname $check_dir)"
@terlar
terlar / fish_prompt.fish
Created October 5, 2012 00:45
Prompt for fish with git statuses
set -U fish_color_user magenta
set -U fish_color_host yellow
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
# User
set_color $fish_color_user
printf (whoami)
set_color normal
@terlar
terlar / gist:4043969
Last active October 12, 2015 14:57
Build ruby
mkdir $HOME/.local/lib/ry/rubies/1.9.3-p327-perf
cd /tmp
curl -O http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar -xf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix="$HOME/.local/lib/ry/rubies/1.9.3-p327-perf"
make
make install
@terlar
terlar / gist:4043979
Created November 9, 2012 05:58
Find connected iCloud machines that accept ssh
dns-sd -B _ssh._tcp
@terlar
terlar / osx
Last active October 13, 2015 12:18
OSX Install
Alfred - http://www.alfredapp.com/
Spectacle - http://spectacleapp.com/
Spotify - http://www.spotify.com/
Glimmerblocker - http://glimmerblocker.org/
Vagrant - http://downloads.vagrantup.com/
@terlar
terlar / 10-local.rules
Last active December 20, 2015 03:28
Guide to dual-boot archlinux
# Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"
@terlar
terlar / cx.mopidy.plist
Created August 2, 2013 07:38
Mopidy as OSX service
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>cx.mopidy</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/mopidy</string>
</array>
@terlar
terlar / README.markdown
Last active October 11, 2019 16:07
ArchLinux on Mac Book Retina 13"
@terlar
terlar / PKGBUILD
Created August 10, 2013 21:02
irssi-script-advanced-windowlist
# Maintainer: Tom Vincent <http://tlvince.com/contact/>
pkgname=irssi-script-advanced-windowlist
_name=adv_windowlist.pl
pkgver=0.7c
pkgrel=2
pkgdesc="Adds a permanent advanced window list to irssi status bar"
arch=(any)
url="http://anti.teamidiot.de/static/nei/*/Code/Irssi/"
source="http://anti.teamidiot.de/static/nei/*/Code/Irssi/$_name"
license=('GPL')
@terlar
terlar / Rakefile
Created October 10, 2013 14:25
Rakefile for test running
require 'rake/testtask'
require 'bundler/gem_tasks'
namespace 'test' do
test_files = FileList['spec/**/*_spec.rb']
integration_test_files = FileList['spec/**/*_integration_spec.rb']
unit_test_files = test_files - integration_test_files
desc 'Run unit tests'
Rake::TestTask.new('unit') do |t|