Skip to content

Instantly share code, notes, and snippets.

@erlend
erlend / inx.sh
Created September 3, 2023 21:09
Script for running GUI applications in Docker or OrbStack with XQuartz
#!/bin/sh
cmd=$*
authorize() {
for host
do xhost | egrep -q "^INET6?:$host$" || xhost + $host
done
}
@erlend
erlend / wait_for.sh
Last active September 25, 2021 02:03
#!/bin/sh
if [ -z "$1" ]; then
cat <<-END_OF_HELP
wait_for
Usage:
wait_for FILE
Checks for existance of file repeatedly until it succeeds then it exits. File
Verifying that +erlendf is my blockchain ID. https://onename.com/erlendf
### Keybase proof
I hereby claim:
* I am erlend on github.
* I am erlend (https://keybase.io/erlend) on keybase.
* I have a public key whose fingerprint is 94B8 99E5 9932 0CF4 9FF0 7CBD A22E 6BAD 16B5 589A
To claim this, I am signing this object:
namespace :db do
task :load_config do
ActiveRecord::Base.configurations = ActiveRecord::Tasks::DatabaseTasks.database_configuration || {}
ActiveRecord::Migrator.migrations_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
if defined?(ENGINE_PATH) && engine = Rails::Engine.find(ENGINE_PATH)
if engine.paths['db/migrate'].existent
ActiveRecord::Migrator.migrations_paths += engine.paths['db/migrate'].to_a
end
end
end
require 'bundler'
Bundler.setup :default
require 'sinatra/base'
require 'sprockets'
require './app'
map '/assets' do
environment = Sprockets::Environment.new
environment.append_path 'assets/javascripts'
environment.append_path 'assets/stylesheets'
@erlend
erlend / hack.sh
Created April 1, 2012 15:56 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#