Skip to content

Instantly share code, notes, and snippets.

View tanordheim's full-sized avatar

Trond Nordheim tanordheim

View GitHub Profile
class ChildModelOne extends ParentModel {
}
class BarNode < Node
field :bar_test
end
module TestModule
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def foo
attr_accessor :test
end
end
Feature: Administration interface
So that I can administer my site
As an administrator
I want to make sure I can access the admin interface if I am authenticated
Scenario: Redirect me to the login page if I am not authenticated
Given I am not authenticated as an admin
When I go to the admin dashboard
Then I should see the form "admin_new"
class Organization
include Mongoid::Document
field :name
referenced_in :user
end
class User
include Mongoid::Document
field :username
references_many :organizations
[playlist]
File1=http://www.p4.no/lyttesenter/p4_norge.m3u
Title1=P4 Radio Hele Norge
Length1=-1
NumberOfEntries=1
Version=2
>> Organization.order("name asc").limit(5).includes([ :web_presence, :billing_address, :shipping_address, :contact_info ])
Organization Load (0.4ms) SELECT "organizations".* FROM "organizations" ORDER BY name asc LIMIT 5
ShippingAddress Load (0.3ms) SELECT "addresses".* FROM "addresses" WHERE ("addresses"."type" = 'ShippingAddress') AND ("addresses".addressable_id = 51 AND "addresses".addressable_type = 'Organization') LIMIT 1
BillingAddress Load (0.3ms) SELECT "addresses".* FROM "addresses" WHERE ("addresses"."type" = 'BillingAddress') AND ("addresses".addressable_id = 51 AND "addresses".addressable_type = 'Organization') LIMIT 1
ContactInfo Load (0.2ms) SELECT "contact_infos".* FROM "contact_infos" WHERE ("contact_infos".contactable_id = 51 AND "contact_infos".contactable_type = 'Organization') LIMIT 1
WebPresence Load (0.3ms) SELECT "web_presences".* FROM "web_presences" WHERE ("web_presences".presenceable_id = 51 AND "web_presences".presenceable_type = 'Organization') LIMIT 1
ShippingAddr
local barmod = Skada.displays["bar"]
barmod.ApplySettings_ = barmod.ApplySettings
barmod.ApplySettings = function(self, win)
barmod:ApplySettings_(win)
-- Custom code goes here
end
<VirtualHost *:80>
ServerAdmin hostmaster@domain.tld
ServerName dev.domain.tld
DocumentRoot /www/railsapp/public
<Directory /www/railsapp>
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@tanordheim
tanordheim / mumble.sh
Created May 1, 2011 12:15
mumble init script
#! /bin/sh
test -f /lib/lsb/init-functions || exit 1
. /lib/lsb/init-functions
start() {
log_begin_msg "Starting Mumble Server 1"
/usr/bin/murmur.x86 -ini /etc/murmur/cfg1.ini || log_end_msg 1
log_end_msg 0