1 2 3 4
<div class="vcard company"> <h3 class="org fn"><%=h company.name %></h3> <% if company.business_address %> ...
Ruby Company hCard
1 2 3 4
function toHTML(code) { code = removeTags(code) code = convertTables(code) ...
JavaScript Markdown-like editor
Hey all, I've created a Mar...
1 2 3 4
alphanumerics = [*('0'..'9')] + [*('A'..'Z')] + [*('a'..'z')] (0...25).map { alphanumerics[Kernel.rand(alphanumerics.size)] }.join ...
Ruby Generating a string of rand...
So this is kind of trivial ...
1 2 3
Declare @Name varchar(128) Declare @Cursor Cursor ...
C# Cache SQL Server Views
Question: Is there anyway t...
1 2 3 4
namespace DataSetTableAdapters { partial class MyTableAdapter { ...
C# TableAdapter and CommandTim...
by Auron,
July 02, 2008 10:19,
6 refactorings, tagged with tableadapter, commandtimeout, dataset, ado, C#, .net
As TableAdapters are are au...
1 2 3 4
# -*- coding: utf-8 -*- ''' Description: Blowfish with custom base64 obfuscation. ...
Python Custom blowfish IRC impleme...
http://fish.sekure.us/ - bl...
1 2 3 4
public static List<T> MergeListCollections<T>(List<T> firstList, List<T> secondList) { List<T> mergedList = new List<T>(); ...
C# Merge generic lists
Toying with some utility me...
1 2 3 4
class ENumber attr_accessor :n, :e ...
Ruby Tracking error in numbers
by Burke,
June 29, 2008 17:05,
2 refactorings
We needed to do a bunch of ...
1 2 3 4
$.fn.textNodes: function() { var ret = []; this.each( function() { ...
JavaScript [jQuery] All descendent tex...
This function returns a jQu...
1 2 3 4
public abstract class I18NException extends Exception { public enum Message implements ExceptionMessage { ...
Java Internationalize Exceptions
This is a template for Exce...
1
ps ax | grep "nginx: master" | xargs -I % ruby -e 'exec "sudo kill #{"%".split(/\s/).first}"'
Bash kill nginx master proces
hi,
i am not expert on lin...
1 2 3 4
import java.io.*; import java.lang.Character; // import java.util.HashMap; ...
Java Simple interpreter
So I was trying to condense...
1 2 3
#!/usr/bin/guile \ -e main -s ...
Lisp CipherSaber
by Chris Jester-Young,
June 22, 2008 05:39,
1 refactoring, tagged with scheme, ciphersaber, encryption
Apparently the last Scheme ...
1 2 3 4
// ***** Encryption and Decryption ***** // byte[] Key(string sText) { ...
C# Encryption and Decryption
This is my first attempt at...
1 2 3 4
// sanitize any potentially dangerous tags from the provided raw HTML input public static string SanitizeHtml(string html) { ...
C# Sanitize HTML
Takes a provided HTML strin...
1 2 3
class MyModel named_scope :not_hidden, :conditions => ['hidden IS NULL OR hidden = 0 OR hidden = ?', 'f'] end
Ruby ActiveRecord: named_scope f...
Can ActiveRecord be used to...
1 2 3 4
def plan_prediction_chart @charge ||= Charge.find(params[:id]) if @charge.dated? ...
Ruby Predicting future values ba...
This could easily be the po...
1 2 3 4
carriers = Carrier.find(:all) @arr = [] ...
Ruby collecting attributes from ...
by DG,
June 17, 2008 10:46,
4 refactorings
In Following snippet I only...
1 2 3 4
class Newalert def new_alert_validations(params) ...
Ruby model validations
Following is the big(easy t...
1 2 3 4
# Ruby Quiz 2 - Scalable LCD Monitor # Gerard (smeevil) de Brieder - Govannon - 2008-06-12 ...
Ruby Looking for comments on sty...
Hi all,
I am looking for...
1 2 3 4
class Newalert def alert_selection(params) ...
Ruby Simple validation
Hi,
Below is the small sni...
1 2 3 4
<?php /* * This is a test of a rules based iterative algorithm... ...
PHP Rules Based Iterator
by James Stansfield,
June 15, 2008 13:52,
1 refactoring, tagged with php, loop, iterate, rules, array
I had need for an iterative...
Looking for a better way to...