Tag Archive for config

Turbogears gitignore

autostart.cgi
bin/*
lib/*
prod.cfg
*.pyc
*.sqlite
*.tmp

source

apache config file remove www from url

RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^(.*)$ <a href="http://example.com$1" >http://example.com$1</a> [R=301,L]

source

.NET SMTP Mail Server

<system.net>
<mailSettings >
<smtp>
<network host="SERVER_NAME"/>
</smtp>
</mailSettings>
</system.net>

source

.irbrc

require 'rubygems'
require 'utility_belt'
require 'irb/completion'
require 'irb/ext/save-history'

ARGV.concat ["--readline"]

IRB.conf[:SAVE_HISTORY] = 200
IRB.conf[:BACK_TRACE_LIMIT] = 50
IRB.conf[:PROMPT_MODE] = <img src='http://www.snippetsmania.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> EFAULT

source

A guide to YUI Config utility

// JScript source code
var Object = function(){
var cfg = new YAHOO.util.Config(this);
element;

initDefaultConfig: function() {

this.cfg.addProperty(
"color",
{
value: "#000000",
handler: setColor
}
);

this.cfg.addProperty(
"width",
{
value: null,
handler: setWidth
}
);

this.cfg.fireQueue();
}

var setColor = function(type, args, obj){
var color = args[0];
YAHOO.util.Dom.setStyle(element, "color", color);
}

var setWidth = function(type, args, obj){
var width = args[0] + "px";
YAHOO.util.Dom.setStyle(element, "width", width);
}

this.init = function(elementId){
element = YAHOO.util.Dom.get(elementId);
initDefaultConfig();
}
};

source

Customize FCKEditor in PHPWCMS

// custom FCKconfig
FCKConfig.ForcePasteAsPlainText	= true ;
FCKConfig.IgnoreEmptyParagraphValue = true ;

FCKConfig.FillEmptyBlocks	= false ;

FCKConfig.FormatSource		= true ;
FCKConfig.FormatOutput		= false ;
FCKConfig.FormatIndentator	= '    ' ;

FCKConfig.EnterMode = 'p' ;

// a minimized customized FCKeditor Toolbar for phpwcms
FCKConfig.ToolbarSets["phpwcms_basic"] = [
['Bold','Italic','Underline','OrderedList','UnorderedList','JustifyLeft','Link','Unlink'],
['SpecialChar','RemoveFormat','PasteText'],
['FitWindow','Source']
] ;

source

Remove comment and empty lines from config files

sed -e '/^[ 	]*#/d' -e '/^$/d'

source

Xml Config Entry to Write out Temporary Assemblies Created for the Serializers

<system.diagnostics>
<switches>
<add name="XmlSerialization.Compilation" value="4"/>
</switches>
</system.diagnostics>

source

YAML Config File Example

#!/usr/bin/ruby -w
require 'yaml'

config = {"pass" => "mybigsecret123", "dir"=>"/cygdrive/c/tmp/", "user"=>"gtcaz", "url"=>"http://snipplr.com"}
p config.to_yaml
open('/cygdrive/c/tmp/config.yml', 'w') {|f| YAML.dump(config, f)}
open('/cygdrive/c/tmp/config.yml') {|f| puts f.read}
conf2 = open('/cygdrive/c/tmp/config.yml') {|f| YAML.load(f) }
conf2.each{ |k, v| puts "#{k} => #{v}" }

source

mailto with config variables

{assign var=foo value=#supportmail#}
{mailto address="$foo" encode="javascript_charcode" text="E-Mail" subject="support mail"}

source