This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# BEFORE: DAEMON | |
# PROVIDE: ezjail.example.config | |
# | |
# ezjail flavour example | |
. /etc/rc.subr | |
name=ezjail.flavour.bijail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>foo</title> | |
<style> | |
div#wrapper { | |
width: 800px; | |
height: 200px; | |
background-color: gray; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: request_counter | |
# REQUIRE: LOGIN | |
# KEYWORD: shutdown | |
. /etc/rc.subr | |
name=request_counter | |
rcvar=request_counter_enable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FreeBSD: { | |
url: "pkg+http://pkg.eu.FreeBSD.org/${ABI}/latest", | |
mirror_type: "srv", | |
enabled: yes | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(). | |
-behavior(gen_server). | |
% Managment API | |
-export([start/0, start_link/0, stop/0]). | |
% gen_server callbacks | |
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, | |
code_change/3]). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def metaclass | |
class << self; self; end | |
end | |
end | |
class Foo | |
def self.hello | |
puts "hello" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
# The hidden singleton lurks behind everyone | |
def metaclass | |
class << self | |
self | |
end | |
end | |
def meta_eval &blk | |
metaclass.instance_eval &blk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
klass.send :define_method, "translated_#{attr_name}", lambda {|*loc| | |
loc = loc.first || I18n.locale | |
globalize.fetch loc, attr_name | |
} | |
klass.send :define_method, "set_translated_#{attr_name}", lambda {|loc, val| | |
globalize.stash loc, attr_name, val | |
self[attr_name] = val | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c10e9ebe037cd6671cfe250dff9c8289d524bc3a Mon Sep 17 00:00:00 2001 | |
From: hukl <contact@smyck.org> | |
Date: Mon, 3 Aug 2009 16:54:06 +0200 | |
Subject: [PATCH] helper method to create translation table no considers table_prefixes | |
--- | |
lib/globalize/model/active_record/translated.rb | 6 +++--- | |
1 files changed, 3 insertions(+), 3 deletions(-) | |
diff --git a/lib/globalize/model/active_record/translated.rb b/lib/globalize/model/active_record/translated.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this in RAILS_ROOT/lib | |
module AccessToken | |
class << self | |
def current=(token) | |
Thread.current[:token] = token | |
end | |
def current |
OlderNewer