1 2 3 4
var hash = new String(document.location).indexOf("#"); if(hash > 0) { ...
JavaScript Small Javascript Code
by openid.aol.com/aviewanew,
October 06, 2008 01:20,
6 refactorings, tagged with ajax, javascript, history
1 2 3 4
#include <iostream.h> int main() { ...
C++ Simple For Loop
by goodespeler.myopenid.com,
October 06, 2008 23:10,
4 refactorings
Can someone check my for lo...
1 2 3
Declare @Index varchar(128) ...
C# Drop all Indexes in SQL Server
The below is some code I re...
1 2 3 4
#controller def search if params[:search] ...
Ruby Search with fulltext, ago-c...
by papricek.myopenid.com,
October 07, 2008 12:52,
3 refactorings
How would you make this cod...
1 2 3 4
#include <iostream.h> #include <stdlib.h> #include <math.h> ...
C++ Prime or Not
This is a simple program to...
1 2 3 4
def translation_links lang = [ %w[en english us], ...
Ruby nested array to set of html...
i have a simple array that ...
1 2 3 4
def writefile(file, *linedata) linedata.each do |line| file << line.join(",") + "\n" ...
Ruby Parsing non-delimited text
I have large text-reports f...
1 2 3 4
Q = jQuery.noConflict(); Q(document).ready(function(){ ...
JavaScript Toggle "Check all / Un...
by chovy.myopenid.com,
October 06, 2008 20:16,
1 refactoring, tagged with javascript html jquery toggler
I have a simple toggler to ...
1 2 3 4
class SearchNestedHashByValue def key_for(h, str, trail=[]) h.each_pair do |k, v| ...
Ruby Search nested hash
Search nested hash on their...
1 2 3 4
WEEKDAYS = %w(mon tue wed thu fri sat sun) dates = [ ...
Ruby Open hours grouping
Actually I really don't kno...
1 2 3 4
setDefaults = Behavior.create({ initialize: function(obj) { myforms = this.element; ...
JavaScript Highlight Selected forms, S...
by openid.aol.com/forwardfootmedia,
October 10, 2008 01:49,
1 refactoring, tagged with prototype, lowpro, Ruby on Rails, javascript
The script binds itself to ...
1 2 3 4
#!/bin/ruby characters_to_use="ABCD" ...
Ruby brute-force password cracker
by Nathan,
October 10, 2008 22:29,
1 refactoring, tagged with password, brute-force, crack, combination, permutation
Just a quick-and-dirty for ...
1 2 3 4
def redirect_to_current_user if params[:id] != current_user.login if params[:action] == "show" ...
Ruby Before Filter URL Redirect ...
I'm using to_param to pass ...
1 2 3 4
$LETTER = Hash[*%w/ A .- N -. B -... O --- ...
Ruby Morse Code Encoder/Decoder
I'm trying to improve my Ru...
1 2 3 4
define("MAX_INFO_SIZE",500);
define("MAX_DATA_SIZE",100000);
define("MAX_THUMBNAIL_SIZE",10000);
...
PHP file upload validation
This function validates fil...
1 2 3 4
#!/usr/bin/python import socket,time ...
Python Connection Detection script
by matthew.scouten.myopenid.com,
October 02, 2008 01:06,
1 refactoring, tagged with short python sockets
This is a Quick and Dirty s...
1 2 3 4
public static void Capitalize() { TextInfo oTextInfo = CultureInfo.CurrentCulture.TextInfo; ...
C# Capitalize directory name w...
I wrote a method to capital...
1 2 3 4
FIELDS = [ 'first', 'last', 'band' ] DATA = [['Kurt', 'Cobain', 'Nirvana'], ['Jimi', 'Page', 'Led Zeppelin'], ...
Ruby Map fields array and data a...
First posting here. I just ...
1 2 3 4
function amortization_array($principal, $interest_rate, $start_year, $start_month, $term, $group_by = 'M, Y', $month_names){
$periods = $term * 12;
$balance = $principal;
...
PHP Mortgage Calculator
by jcapote,
September 24, 2008 23:27,
3 refactorings
How would you refactor this...
1 2 3 4
Private Function fIsAppRunning() As Boolean 'Looks to see if Lotus Notes is open ...
VB.NET Remove the Evil GOTO
This horrible code I inheri...
1 2 3 4
#!/usr/bin/env ruby # == Synopsis ...
Ruby Source code analysis
by Tj Holowaychuk,
September 26, 2008 03:04,
3 refactorings
Small class to analyze scri...
It's for detecting if you'r...