Skip to content

Instantly share code, notes, and snippets.

View dsci's full-sized avatar

Daniel Schmidt dsci

  • Leipzig, Germany
View GitHub Profile

How To: Authlogic to Devise

Step 1: Migration

  1. bin/rails g migration AuthlogicToDevise
  2. (see the file below for the actual migration, authlogic_to_devise.rb)
  3. bin/rake db:migrate

Step 2: Update Gemfile

  1. gem "devise", "~> 2.2.0"
  2. bundle install
@dsci
dsci / Dockerfile
Last active August 29, 2015 14:19 — forked from konklone/Dockerfile
Rachel Dockersetup
FROM ubuntu
MAINTAINER ''
# Needed?
# turn on universe packages
#RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
# Prepare Ubuntu and Rachel dependencies
RUN apt-get update
RUN apt-get install -y build_essential
@dsci
dsci / private_accessing.rb
Last active August 29, 2015 14:23
private_accessing.rb
class Bar
def self.foobar
end
private_class_method :foobar
end
class XX < ActiveRecord::Base
self.abstract_class = true
establish_connection :db_key
end
Exception sending context initialized event to listener instance of class org.jruby.rack.rails.RailsServletContextListener
java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class org.jruby.RubyObject$ObjectMethods$s_method_0_0$RUBYINVOKER$intialize)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1854)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jruby.internal.runtime.methods.InvocationMethodFactory.tryClass(InvocationMethodFactory.java:1109)
at org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethodClass(InvocationMethodFactory.java:714)
at org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethod(InvocationMethodFactory.java:677)
@dsci
dsci / Quotes.md
Last active September 4, 2015 04:35

Wertvolles,Nicht wertvolles, hängen gebliebenes

Ohne Musik wäre das Leben ein Irrtum - hat man bemerkt dass die Musik den Geist frei macht, dem Gedanken Flügel gibt? -- Musik ist das von selber Ertönen der tiefsten Einsamkeit.

(Grabnebelfürsten)

We didn't receive any messages and Captain Blackadder definitely did not shoot the delicious plump breasted pigeon, Sir.

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@dsci
dsci / plugin_loader.rb
Created August 30, 2011 13:42 — forked from robhurring/plugin_loader.rb
Simple way to load Rails plugins in Sinatra
# Simple bootloader for Rails plugins in Sinatra
# This checkes the +plugin_folder+ for plugin-like bundles. For each folder it finds it will do:
# If the +lib+ folder exists: add it to our load path
# If a +init.rb+ file exists: require it
# Not very robust but it is lightweight for loading simple rails plugins
class PluginLoader
attr_reader :plugin_folder
def initialize(plugin_folder)
@plugin_folder = plugin_folder
@dsci
dsci / gist:1313822
Created October 25, 2011 18:49
test
def foo(*args,&data)
data.call
end
@dsci
dsci / cherry_pick.sh
Created October 26, 2011 11:01
git sheet
git cherry-pick commit_hash