Skip to content

Instantly share code, notes, and snippets.

View dagda1's full-sized avatar

Paul dagda1

View GitHub Profile
public static class DropDownListForExtensions
{
public static IEnumerable<SelectListItem> EnumToSelectList<TEnum>(this TEnum enumObj, string defaultItem = null) where TEnum : struct
{
if (!typeof(TEnum).IsEnum) throw new ArgumentException("An Enumeration type is required.", "enumObj");
var list = new List<SelectListItem>(from TEnum e in Enum.GetValues(typeof(TEnum))
select new SelectListItem{Value = e.ToString(), Text = System.Text.RegularExpressions.Regex.Replace(
e.ToString(),
"([A-Z])",
source 'http://rubygems.org'
#source 'http://gems.engineyard.com'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'compass'
gem 'haml'
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %>
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
$(function () {
var ele_id = 'appResource';
var auto_complete = $( '#' + ele_id);
var auto_complete_hidden = $('<input id="' + ele_id + '_auto_complete_hidden' + '" type="hidden"/>');
auto_complete_hidden.insertAfter(auto_complete);
auto_complete.autocomplete({
source: app_resource_url,
minLength: 1,
name: Castle.Facilities.NHibernateIntegration
description: The NHibernate Facility enables the usage of NHibernate O/R framework for your components.
build: msbuild;profile=net40;project=src\Castle.Facilities.NHibernateIntegration\Castle.Facilities.NHibernateIntegration-vs2010.csproj
depends: openwrap anchored content
depends: castle.windsor
depends: log4net
depends: castle.services.transaction
depends: nhibernate
depends: Castle.Facilities.AutomaticTransactionManagement
function Create-VirtualDir($Parent, $FriendlyName, $VirPath)
{
$newdir = $Parent.Create("IISWebVirtualDir", $FriendlyName)
[Void]$newdir.Put("Path", $VirPath)
[Void]$newdir.Put("AccessRead", $true)
[Void]$newdir.Put("AccessWrite",$true)
[Void]$newdir.Put("AccessScript", $true)
[Void]$newdir.AppCreate2(1)
[Void]$newdir.Put("AppFriendlyName", $FriendlyName)
[Void]$newdir.SetInfo()
@dagda1
dagda1 / ajax.js
Created February 8, 2011 10:17
jquery 1.5 ajax
function getJSONObject(url, params, ajaxCallBack, ajaxErrorHandler, excludeProgress){
var e = (ajaxErrorHandler) ? ajaxErrorHandler : validationErrorCallBack;
var s = (ajaxCallBack) ? ajaxCallBack : jsonCallBack;
if (!excludeProgress)
$('#working').show();
$.ajax({
type: "POST",
url: url,
cache: false,
data: params,
source 'http://rubygems.org'
source 'http://gems.engineyard.com'
gem 'rails'
gem 'compass'
gem 'haml'
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3'
gem 'nokogiri'
@dagda1
dagda1 / gist:838452
Created February 22, 2011 10:05
database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: <%= defined?(JRUBY_VERSION) ? 'jdbcsqlite3' : 'sqlite3' %>
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
class AsmInfoBuilder
attr_reader :buildnumber
def initialize(baseVersion, properties)
@properties = properties;
@buildnumber = baseVersion + (ENV["CCNetLabel"].nil? ? '0' : ENV["CCNetLabel"].to_s)
@properties['Version'] = @properties['InformationalVersion'] = buildnumber;
end