require 'rubygems' require 'active_record' require 'benchmark' ...
Ruby ActiveRecord threaded bench...
by Kevin Williams,
February 20, 2008 04:33,
6 refactorings, tagged with orm, activerecord, benchmark
javascript:(function(){
var elm = document.getElementsByTagName("img");
for (var i = 0; i < elm.length; i++) {
...
JavaScript Zoom all image files from s...
This one comes straight fro...
before_same :titlecase_fields def titlecase_fields ...
Ruby ActiveRecord Attributes rej...
by Aditya,
February 28, 2008 15:41,
4 refactorings
I'd like to run titlecase m...
def squarebutton(name, options = {}, html_options = nil)
...
Ruby Adding default html option ...
by Michael Filbin,
February 26, 2008 20:39,
3 refactorings, tagged with method, ActionView, UrlHelper, link_to
I have css directives for s...
# in lib/product_scraper/base.rb class ProductScraper::Base def product_pages ...
Ruby OO Ruby help, por favor
This is really my first att...
function odump(object, depth, max){
depth = depth || 0;
max = max || 2;
...
JavaScript Recursively dump an object
Given an object, iterate th...
#include <stdio.h> #include <math.h> int main () ...
C Quanti bit per rappresentar...
Dato un intero,determinare ...
make_resourceful do
actions :all
before(:create) { current_object.user = current_user }
...
Ruby make_resourceful plugin wit...
by rajesh,
February 25, 2008 20:06,
1 refactoring, tagged with make_resoureful, google maps, ym4r_gm
Hi,
I have this contract...
def init_scite_buffer
# Check for allready opened files
res = @director.send_command('savesession', '/tmp/SciTE.session', false)
...
Ruby Wait for file create
This method sends a command...
<? php
if $userinput = "http://www."
{
...
PHP Replace user input with link
by Mlopez,
January 02, 2008 01:39,
28 refactorings, tagged with http, parsing, phrasing, help, user, php, url, with, text, replace
im not quite sure where to ...
@wordsToHighlight=["important","monkey","dancing"] def highlightText(input) for i in 0..@wordsToHighlight.length-1 do ...
Ruby Rubyize this : 5th edition
by FrankLamontagne,
January 03, 2008 13:33,
16 refactorings
Here is the 5th edition of ...
def filename
self.uri.split('/').last
...
C# Get the Filename segment o...
by jwmittag,
January 01, 2008 15:04,
11 refactorings, tagged with Comparison, Scott Porad, asp.net, DotNET, .net, C-Sharp, CSharp, C#, RoR, Ruby on Rails, rails, ruby
On his Blog "Progress vs. P...
function db_cache_2($query)
{
// Query cache table
...
PHP DB Cache
by ellisgl.myopenid.com,
January 14, 2008 22:48,
8 refactorings, tagged with php, cache, mysql, update
It's a DB caching scheme th...
module ApplicationHelper
def time_month(month)
return Time.now.months_ago(month)
...
Ruby last_number_of_months
Just wrote my first rails a...
/**
* warning performs a cartesian product
* @param list of NameAddress objects
...
Java clean up nested loops?
by getopenid.com/garretokelly,
January 16, 2008 21:10,
6 refactorings
Given a list of NameAddress...
function showEMail() {
var e = [ 'm','y','e','m','a','i','l','@','x','y','z','.','c','o','m' ];
var s = '';
...
JavaScript Anti-spam Mailto
Here's a straightforward an...
def planned_percent_complete
if self.planned_complete_in_dollars != nil
(( self.planned_complete_in_dollars.to_f / self.task.budget.to_f ) * 100).round(2)
...
Ruby Same methods, different Act...
I know there has to be a "r...
require 'net/http' require 'uri' require 'strscan' ...
Ruby Display jpg image url from ...
This code display jpg image...
<?php
function fetch($url,$start,$end){
...
PHP Wikipedia API and text form...
by z3ro,
January 09, 2008 18:37,
4 refactorings, tagged with convert, html, plain html, formatting, parser, regex, xml, php, wikimedia, api, wikipedia
I need to add Wikipedia's i...
<table class="charge">
<tr>
<td colspan="100%" class="mainHeader"><%=@label.label%></td>
...
Ruby Iterating through a nested ...
by mwilliams,
January 31, 2008 18:21,
3 refactorings, tagged with rails, ruby, Ruby on Rails, view, table, hash, nested hash, iterator, iterate
Good afternoon. I have a n...
<?php
require_once("arc/ARC2.php"); // http://arc.semsol.org/
...
PHP Parse del.icio.us RSS feed
Uses ARC RDF parser from ht...
first of three benchmarks, ...