Skip to content

Instantly share code, notes, and snippets.

View kaipr's full-sized avatar

Kai Pruess kaipr

  • Hamburg, Germany
View GitHub Profile
# https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/
git clone --bare https://github.com/kaipr/dotfiles $HOME/.dotfiles
function dotf {
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
dotf checkout
if [ $? = 0 ]; then
@kaipr
kaipr / gist:1718254
Created February 1, 2012 17:38
Purugin Vault integration tryout
# Original java code
RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
if (economyProvider != null) {
economy = economyProvider.getProvider();
}
# Converted to Ruby
economy_class = (Java::net.milkbowl.vault.economy.Economy).java_class
#> class net.milkbowl.vault.economy.Economy
economy_provider = getServer.getServicesManager.getRegistration(economy_class)
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index b6f0511..5223ac5 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -842,8 +842,8 @@ module ActiveRecord
def fixtures(*table_names)
if table_names.first == :all
- table_names = Dir["#{fixture_path}/**/*.{yml,csv}"]
- table_names.map! { |f| f[(fixture_path.size + 1)..-5] }