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
# -> /etc/fail2ban/filter.d/devecot.conf | |
# Fail2Ban configuration file | |
# | |
# Author: burner | |
# | |
# $Revision: 1 $ | |
# | |
[Definition] | |
# Option: failregex |
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
# Request in the feature -> ... the user show "foo" page by "login" | |
# -> features/support/paths.rb | |
when /^the (.*) (edit|show)( "([^\"]*)")? page by "([^\"]*)"$/i | |
case $2 | |
when "edit","show" | |
klass = $1.singularize.capitalize.constantize | |
obj = klass.send("find_by_#{$5.singularize}", $4) if $4 && $5 | |
raise "could not find #{$3} #{$1}" unless obj | |
return self.send("edit_#{$1.downcase.singularize}_path",obj) if $2=="edit" |
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
# This defines a deployment "recipe" that you can feed to capistrano | |
# (http://manuals.rubyonrails.com/read/book/17). It allows you to automate | |
# (among other things) the deployment of your application. | |
# ============================================================================= | |
# REQUIRED VARIABLES | |
# ============================================================================= | |
# You must always specify the application and repository for every recipe. The | |
# repository must be the URL of the repository you want this recipe to | |
# correspond to. The deploy_to path must be the path on each machine that will |
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
# controller | |
private | |
def find_polymorphic | |
params.each do |name, value| | |
if name =~ /(.+)_id$/ | |
return $1.classify.constantize.find(value) | |
end | |
end | |
nil | |
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
/* | |
* TypeHelpers version 1.0 | |
* Zoltan Hawryluk, Nov 24 2009. | |
* @see http://www.useragentman.com/blog/2009/11/29/how-to-detect-font-smoothing-using-javascript/ | |
* | |
* Released under the MIT License. http://www.opensource.org/licenses/mit-license.php | |
* | |
* Works for | |
* - IE6+ (Windows), | |
* - Firefox 3.5+ (Windows, Mac, Linux), |
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
# USAGE: Hash.from_libxml(YOUR_XML_STRING) | |
require 'xml/libxml' | |
# adapted from | |
# http://movesonrails.com/articles/2008/02/25/libxml-for-active-resource-2-0 | |
class Hash | |
class << self | |
def from_libxml(xml, strict=true) | |
begin | |
XML.default_load_external_dtd = false |
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
def age(birthday) | |
y = Date.today.year - birthday.year | |
m = Date.today.month - birthday.month | |
d = Date.today.day - birthday.day | |
case | |
when m < 0 | |
age = y-1 | |
when m = 0 | |
case | |
when d = 0 |
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
/** | |
* Bugfix for line-height bug on sup/sub element | |
* | |
* @bugfix | |
* @affected IE 5.x/Win, IE6, IE7 | |
* @css-for IE 5.x/Win, IE6, IE7 | |
* @yalid yes | |
*/ | |
html sup, |
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
// Redaxo Modul Aktion für die Erweiterung der möglichen Datenfelder | |
// Zuordnung der Redaxo Aktion zum entsprechenden Modul nicht vergessen! ;) | |
// Presave/Postsave-Action (jeweils in das Textfeld einfügen) | |
<?php | |
$newname = ""; | |
for ($c=0;$c<99;$c++) | |
$newname .= $rexname[$c]."~"; | |
if ($REX_ACTION[VALUE][1] != "") |
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
<?php | |
// Ersetze template mit dem Namen deines Templates | |
template_preprocess_node(&$variables) { | |
$variables['content']['body]['#items'][0]['summery']['#prefix'] = '<p>; | |
$variables['content']['body]['#items'][0]['summery']['#prefix'] = '</p>; | |
} | |
?> |
OlderNewer