1 2 3 4
private string getMD5String(string PlainText) { System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); ...
1 2 3 4
using System.Security.Cryptography; public class CryptographyRSA() ...
C# Cryptography with RSA and B...
This is a simple example of...
1 2 3 4
/** * http://www.openjs.com/scripts/events/keyboard_shortcuts/ * Version : 2.01.B ...
JavaScript Handling Keyboard Shortcuts...
by Tien Dung,
July 29, 2008 09:30,
1 refactoring
I found below code very use...
1 2 3 4
module ThinkingSphinx class Search class << self ...
Ruby How to extend a class prope...
Recently, I need to extend ...
1 2 3 4
class AccountsController < ApplicationController layout 'application' ...
Ruby Password update code
Mostly straight from a tuto...
1 2 3 4
private static Regex _namedtags = new Regex (@"</?(?<tagname>\w+)[^>]*(\s|$|>)", RegexOptions.Singleline | RegexOptions.ExplicitCapture); ...
C# Balance HTML Tags
For the subset of HTML tags...
1 2 3 4
private static Regex _tags = new Regex("<[^>]*(>|$)", RegexOptions.Singleline | RegexOptions.ExplicitCapture | RegexOptions.Compiled); private static Regex _whitelist = new Regex(@" ...
C# Sanitize HTML
Takes a provided HTML strin...
1 2 3 4
class JobBoard < ActiveRecord::Base has_many :job_board_postings ...
Ruby Ruby has_finder on has_many ?
This smells... one of the m...
1 2 3 4
require 'rubygems' require 'data_mapper' require 'benchmark' ...
Ruby DataMapper threaded benchmark
third of three - slowest of...
1 2 3 4
require 'rubygems' require 'sequel' require 'benchmark' ...
Ruby Sequel threaded benchmark
second of three, not as fas...
1 2 3 4
require 'rubygems' require 'active_record' require 'benchmark' ...
Ruby ActiveRecord threaded bench...
by Kevin Williams,
February 20, 2008 04:33,
No refactoring, tagged with orm, activerecord, benchmark
first of three benchmarks, ...
1 2 3 4
class Fixnum def <=>(b) self % b ...
Ruby Challenge: Ugliest Ruby Fiz...
by jamesgolick,
December 20, 2007 21:54,
8 refactorings
So, after seeing some ugly ...
1 2 3
class PostsController < ResourceController::Base ...
Ruby resource_controller: Redesi...
Backstory on my blog: http:...
1 2 3
document.write ('<noscript>\n'); document.write (imageClick); document.write ("</noscript>");
JavaScript I care about older browsers...
by Gary Haran,
October 30, 2007 22:30,
3 refactorings
I found this great piece of...
1 2 3 4
class String def postal? self.match(/[a-zA-Z]{1}\d{1}[a-zA-Z]{1}([\x20-])*\d{1}[a-zA-Z]{1}\d{1}/) ? true : false ...
Ruby Is This String Postal?
We've had the debate over w...
1 2 3 4
namespace :migrations do desc 'reverts, renames and re-executes uncommitted migrations that conflict with already committed migrations' ...
Ruby Rails migration conflict re...
Explained here: http://www....
1 2 3 4
require 'erb' class ClientMigrator def self.create(fields) ...
Ruby Dynamic migrations for rails
by danielharan,
October 12, 2007 04:27,
1 refactoring
How do you create a rails p...
1 2 3 4
if self.location_type.to_s == 'point' breaker = self.lang == 'fr' ? 'proximite' : 'near' else ...
1 2 3
tab()
...
Bash On Open a new tab in current d...
by Marco Valtas,
October 10, 2007 05:00
Macournoyer, I tried your f...
1 2 3
/* Copyright (c) 2007 the authors listed at the following URL, and/or ...
Java On Fastest way to sort doubles...
by Marco Valtas,
October 02, 2007 21:49
I forgot to paste the Quick...
1 2 3
import java.util.Arrays; ...
Java On Fastest way to sort doubles...
by Marco Valtas,
October 02, 2007 21:45
Well, first of all I'm not ...
Java On Fastest way to sort doubles...
by Marco Valtas,
October 02, 2007 06:41
There´s a reason to not us...

This is a simple example of...