Skip to content

Instantly share code, notes, and snippets.

View marhan's full-sized avatar

Markus Hanses marhan

View GitHub Profile
@marhan
marhan / index.html
Created December 17, 2010 17:42
Complete website with iframe
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Full Page IFrame</title>
<style type="text/css">
html {overflow: auto;}
html, body, div, iframe {margin: 0px; padding: 0px; height: 100%; border: none;}
iframe {display: block; width: 100%; border: none; overflow-y: auto; overflow-x: hidden;}
</style>
@marhan
marhan / eclipse.ini
Created December 28, 2010 12:40
additions to eclipse.ini for version 3.6.x
...
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
@marhan
marhan / TCMounter.groovy
Created January 4, 2011 20:38
Groovy Script for mounts with TrueCrypt
// List of mounts
List<Mount> mounts = [new Mount("/PATH/TO/image.tc", "/PATH/TO/MOUNT")];
// Invocation of routines
TCAutoMounter mounter = new TCAutoMounter(mounts, args[0]);
mounter.mount();
// OOP
/**
* Mounts automatically all defined sources to destinations.
@marhan
marhan / Gemfile
Created January 12, 2011 07:47
Switch for sqlite3 with jruby
# JRUBY_VERSION has to be set as Shell variable.
if defined?(JRUBY_VERSION)
gem 'jdbc-sqlite3'
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcsqlite3-adapter'
gem 'jruby-openssl'
gem 'jruby-rack'
gem 'warbler'
else
@marhan
marhan / env.rb
Created October 1, 2011 15:01 — forked from bsodmike/env.rb
features/support/env.rb for Rails + Cucumber + Spree + Spork
require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= "cucumber"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber'
require 'cucumber/rails'
require 'cucumber/formatter/unicode' # Comment out this line if you don't want Cucumber Unicode support
@marhan
marhan / env.rb
Created October 1, 2011 16:02 — forked from bmabey/env.rb
how to get spork working for cucumber in a rails app
require 'rubygems'
require 'spork'
Spork.prefork do
# Sets up the Rails environment for Cucumber
ENV["RAILS_ENV"] ||= "cucumber"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'webrat'
@marhan
marhan / devise.de.yml
Created October 1, 2011 20:18 — forked from chrugail/devise.de.yml
german i18n for devise
de:
errors:
messages:
not_found: "nicht gefunden"
already_confirmed: "wurde bereits bestätigt"
not_locked: "ist nicht gesperrt"
devise:
failure:
unauthenticated: 'Sie müssen sich anmelden oder registrieren, bevor Sie weiterfahren können.'
@marhan
marhan / application.rb
Created October 6, 2011 08:11
Specific Layout for devise
config.to_prepare do
Devise::SessionsController.layout "signed_out"
Devise::RegistrationsController.layout proc { |controller| user_signed_in? ? "application" : "signed_out" }
Devise::ConfirmationsController.layout "signed_out"
Devise::UnlocksController.layout "signed_out"
Devise::PasswordsController.layout "signed_out"
end
@marhan
marhan / rails31init.md
Created October 8, 2011 08:56 — forked from linojon/rails31init.md
Rails 3.1 with Rspec, Factory Girl, Haml, Simple Form, Devise, CanCan, Nifty, Database Cleaner, Spork, and Guard

Install Rails 3.1

gem install rails

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@marhan
marhan / spec_helper.rb
Created October 8, 2011 13:03 — forked from southgate/spec_helper.rb
spec/spec_helper.rb snippet for including Haml Helpers
RSpec.configure do |config|
# snip
config.include Haml, :type => :helper
config.include Haml::Helpers, :type => :helper
config.before(:each, :type => :helper) do |config|
init_haml_helpers
end
# snip