1 2 3 4
<?php function parse_accept_headers($default = 'html'){ $formats = array( ...
1 2 3 4
namespace MyUtilities { using System; using System.Diagnostics; ...
C# Int32 Quick Parser
I wrote a few parsing metho...
1 2 3 4
#!/usr/bin/perl use strict; use warnings; ...
Perl Find the file with the high...
Here's a small script that ...
1 2 3 4
def before_create_save(record) vouchercode = generate_vouchercode(8) while Voucher.find(:first, :conditions => {:vouchercode => vouchercode}) ...
Ruby While loop to get unique value
Coming from python, I would...
1 2 3 4
object.constraints.each do |c| p = object.particles[c.index] if c.component == :x ...
Ruby ruby metaprogramming
So here here my ugly code. ...
1 2 3 4
require 'ostruct' require 'rubygems' require 'extlib/blank' ...
Ruby includes_all?
by Tj Holowaychuk,
January 05, 2009 21:14,
3 refactorings
Having brain cramps today, ...
1 2 3
$.fn.grow_input = function() { return this.each(function() { ...
JavaScript Expanding input list using ...
The idea is to have a expan...
1 2 3 4
/* study_2008.001.02_field_control.js See: http://gregelin.com/studies/study_2008.001.02 ...
JavaScript Streamline attaching onPast...
by gregelin.myopenid.com,
January 03, 2009 16:36,
No refactoring, tagged with javascript prototype forms
Can the following be stream...
1 2 3 4
class Light def initialize(location) @location = location ...
Ruby Command Pattern from Head F...
Example in Ruby of Command ...
1 2 3
#!/bin/bash echo -e "\n I wish you a merry Christmas and an happy new year! \n" exit(0);
Bash Multi language refactor
by Eineki,
December 25, 2008 08:59,
6 refactorings
Can you rewrite this onelin...
1 2 3 4
grammar Expr; options { backtrack=true; ...
Java ANTLR / Java
This is a mix of ANTLR ( ht...
1 2 3 4
brew = "rdadadroxmocpronogomocdmqzx" alphabet = "abcdefghijklmnopqrstuvwxyz" word = "" ...
Ruby Newb needs some cleanup
Some code I've written for ...
1 2 3 4
def with_infinity(date_unit) limit = 20 (date_unit..Inf).each do |x| ...
Ruby RSpec example does not cont...
This piece of code specifie...
1 2 3 4
#include <iostream> using namespace std; ...
C++ while reads some integers a...
by buk,
December 18, 2008 21:50,
4 refactorings
hi,
first time here dont...
1 2 3
class SteamController < ApplicationController ...
Ruby Doing it wrong? ScRUBYt
by sfusion.myopenid.com,
December 18, 2008 19:37,
3 refactorings
Can't help but feel I might...
1 2 3 4
def space_out_camel_case(stringAsCamelCase): """Adds spaces to a camel case string. Failure to space out string returns the original string. >>> space_out_camel_case('DMLSServicesOtherBSTextLLC') ...
Python CamelCase to Camel Case (Py...
by bigsassy.myopenid.com,
December 18, 2008 19:06,
1 refactoring, tagged with short, snippet, camelcase, camel case, re, regular expression
Hi, I'm a python newbie. C...
1
category_id = category_name.scan(/category-(\d+)/)[0][0]
Ruby Ugly RegEx Accessor
I try to extract an id from...
1 2 3 4
require 'rubygems' require 'hpricot' ...
Ruby Screen Scraping Google with...
by zigx.myopenid.com,
December 18, 2008 00:48,
7 refactorings, tagged with ruby, hpricot, watir, google, scrape
Would love to see a COOLer ...
1 2 3 4
# sum an an array's elements def sum_row(a) sum = 0 ...
Ruby Conditionally deleting colu...
I needed to read in a CSV f...
1 2 3 4
def run_once &block path = File.expand_path caller.first unless ($__run_once ||= []).include? path ...
1 2 3 4
# Jhippo.java package Jhippo; ...
Java Jhippo
by tak11.myopenid.com,
December 16, 2008 04:14,
No refactoring, tagged with pircbot, java, irc, bot, swing, gui
Java irc bot using Pircbot....
1 2 3 4
#!/usr/bin/perl
#smtp scanner by Tak
...
Perl Smtp Scanner
by tak11.myopenid.com,
December 16, 2008 04:07,
No refactoring, tagged with smtp, scanner, port, perl
I wrote this a LOONGG time ...
1 2 3 4
<?php
function isvalid_url($url)
{
...
PHP check for valid url
Hi everyone..is there other...
a) define a list of MIME ty...