1 2 3
def invite_friends ...
Ruby Contoller refactoring
by DG,
July 30, 2008 09:35,
2 refactorings
1 2 3
#include <math.h> #include <stdio.h> ...
C Fastest way to get value of pi
by Chris Jester-Young,
July 30, 2008 03:50,
No refactoring, tagged with pi, speed, language agnostic
Solutions welcome in any la...
1 2 3
def granny_says(str) ...
Ruby Exercise: Deaf Grandma
by houston b-g,
July 29, 2008 18:28,
4 refactorings
I've been working on this p...
1 2 3 4
if @foo.update_attributes(params[:foo]) and @foo.bar.update_attributes(params[:bar]) redirect_to foo_url(@parent) else ...
Ruby Saving multiple models in o...
by rafeco,
July 29, 2008 15:56,
1 refactoring, tagged with rails, activerecord, controller
What's the best way to save...
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,
2 refactorings
I found below code very use...
1 2 3 4
module ThinkingSphinx class Search class << self ...
Ruby How to extend a class prope...
by Tien Dung,
July 29, 2008 04:09,
No refactoring, tagged with ruby metaprogramming
Recently, I need to extend ...
1 2 3
+----------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
PHP Object with Field names as ...
by Ishkur,
July 28, 2008 19:35,
4 refactorings, tagged with php5, field names, database, object
What I am trying to do is a...
1 2 3 4
def tab(name, options = {}) if name == controller.controller_name.humanize || root_of_path.humanize == name content_tag :li, link_to("<span>#{name}</span>", options), :class => "active" ...
Ruby How to DRY this up
by idlefingers,
July 25, 2008 13:30,
4 refactorings, tagged with rails, tabs
This is for a tabbed naviga...
1 2 3 4
require 'win32ole' autoit = WIN32OLE.new('AutoItX3.Control') ...
Ruby Easier way to do this?
by tyranarchy.myopenid.com,
July 24, 2008 07:08,
No refactoring
This is for the online poke...
1 2 3 4
this.getHttpRequest(identifier).onreadystatechange = function() { try { ajaxChat.handleResponse(identifier); ...
JavaScript AJAX makeRequest
by Martindale,
July 23, 2008 03:02,
1 refactoring, tagged with ajax
This code crashes Firefox 3...
1 2 3 4
class User < ActiveRecord::Base has_many :orders ...
Ruby rails ActiveRecord finder_s...
by jared,
July 23, 2008 00:36,
1 refactoring, tagged with rails activerecord finder_sql
I think there's a way to do...
1 2 3 4
%w(er_quantitative pr_quantitative p53_quantitative fish_quantitative oncotype_quantitative).each do |field| class_eval <<-RUBY def #{field}_s ...
Ruby Formating a decimal field a...
by jdzak.myopenid.com,
July 22, 2008 22:57,
No refactoring
er_quantitative, pr_quantit...
1
v = a[:k][0] || 1
Ruby Assignment from array
by jason,
July 22, 2008 10:15,
7 refactorings
The problem with this code ...
1 2 3 4
puts "Yes means No and No means Yes. Delete all files [Y]?" yes, no = "no", "yes" ...
Ruby BOFH shell login script
by aaaarg.livejournal.com,
July 21, 2008 23:23,
1 refactoring
Optimize for poeticness.
1 2 3 4
module DashboardHelper def activity_message_for(object) case object.class.name ...
Ruby Dashboard
by Kryckan,
July 21, 2008 21:01,
4 refactorings, tagged with rails, helper
This works but it's kind of...
1 2 3 4
<?php class DB { ...
PHP PHP5 Database Clas
by Ishkur,
July 21, 2008 16:33,
2 refactorings, tagged with php5, database, class
For the most part, this cla...
1 2 3 4
#!/usr/bin/perl use strict; use warnings; ...
Perl MAC Formatting
by mrxinu,
July 20, 2008 23:25,
3 refactorings, tagged with mac snmp
Converting the return from ...
1 2 3 4
# This method searches a source by the http, the www and the trailing / to a url def self.find_by_url(url) Source.find :first, :conditions => [ " url = ? OR url = ? OR url = ? OR url = ? ", url, url.gsub("http://", "http://www"), url + "/", url.gsub("http://", "http://www")+"/"] ...
Ruby Find a URL in a database
by julien,
July 18, 2008 17:16,
3 refactorings, tagged with find, url
Hi!
I've a got a website A...
1 2 3 4
module Enumerable def cluster sort.inject([[]]) do |out, n| ...
Ruby Enumerable#cluster
by Erik,
July 18, 2008 02:44,
10 refactorings, tagged with cluster, inject, array
%w[app noot app mies zoo m...
1 2 3 4
def link_to_param(text, param, values) @qs ||= {} if @qs.blank? ...
Ruby Horrible method to parse a ...
by Ivan,
July 17, 2008 22:45,
2 refactorings, tagged with rails, links, query string
In a Rails application, I h...
1 2 3 4
def self.paged_search(query, from, category, locality, page, per_page = 10) query_str = [] query_prms = [] ...
Ruby Ferret, pagination and mult...
by jboss,
July 17, 2008 07:34,
No refactoring, tagged with rails, search, find, join, ferret, paginate
This code has multiple flaw...
1 2 3 4
class AccountsController < ApplicationController layout 'application' ...
Ruby Password update code
by danielharan,
July 16, 2008 16:59,
4 refactorings, tagged with rails, restful, authentication
Mostly straight from a tuto...
1 2 3
-module(endsrename). ...
Erlang Nintendo DS roms renamer
by edbond,
July 16, 2008 13:00,
No refactoring, tagged with erlang, nintendo, ds, nintendo ds, rename, otp
Nintendo DS roms and saves ...
1 2 3
class Findplugin ...
Ruby Showing list of plugins in ...
by DG,
July 15, 2008 12:41,
No refactoring
Hello,
- I am working on a...
1 2 3 4
# A set of monkey patches for the ruby programmer who isn't yet satisified with the core library class Object # useful for reflection ...
Ruby A Set of Monkey Patches for...
by Ollie ,
July 15, 2008 04:06,
No refactoring, tagged with core library, monkeypatch, monkey patch
I find ruby's core library ...
« Previous 1 2 3 4 5 6 7 8 9 ... 14 15 Next »
In following Home controlle...