#!/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...

5a00a3a98dcf6f9cd717440fd2b606e5 Talk
# This is what an application build with our framework would look like.
# Run with:
#   rackup app.ru
...

Ruby Very Simple Rack framework

by macournoyer, September 14, 2008 18:11, 1 refactoring, tagged with rack

I'll be presenting http://r...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
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...

880cbab435f00197613c9cc2065b4f5a Talk
using System;
using System.Collections.Generic;
using System.Linq;
...

C# Pointers in C#

by Andre Steenveld, May 06, 2008 10:39, 1 refactoring, tagged with C#, Unsafe, pointers, unmanaged

I am trying to work out how...

D41d8cd98f00b204e9800998ecf8427e Talk
class JobBoard < ActiveRecord::Base
  has_many :job_board_postings
  
...

Ruby Ruby has_finder on has_many ?

by danielharan, April 01, 2008 16:10, 1 refactoring, tagged with has_finder rails

This smells... one of the m...

880cbab435f00197613c9cc2065b4f5a Talk
class Fixnum
  def <=>(b)
    self % b
...

Ruby Challenge: Ugliest Ruby Fiz...

by jamesgolick, December 20, 2007 21:54, 8 refactorings

So, after seeing some ugly ...

F6eddf2f983d23c2d031e407852625e9 Talk
<%= (@post.category ? @post.category.name : '') + ' ' + link_to(@post.title, post_path(@post)) %>

Ruby Handling nil object

by macournoyer, November 14, 2007 02:07, 13 refactorings, tagged with rails, html

@post.category can be nil, ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
class PostsController < ResourceController::Base
...

Ruby resource_controller: Redesi...

by jamesgolick, November 05, 2007 20:27, 7 refactorings, tagged with rails, resource, restful

Backstory on my blog: http:...

F6eddf2f983d23c2d031e407852625e9 Talk
namespace :migrations do
  
  desc 'reverts, renames and re-executes uncommitted migrations that conflict with already committed migrations'
...

Ruby Rails migration conflict re...

by danielharan, October 26, 2007 18:25, 1 refactoring, tagged with rails

Explained here: http://www....

880cbab435f00197613c9cc2065b4f5a Talk
require 'erb'
class ClientMigrator
  def self.create(fields)
...

Ruby Dynamic migrations for rails

by danielharan, October 12, 2007 04:27, 1 refactoring

How do you create a rails p...

880cbab435f00197613c9cc2065b4f5a Talk
tab() # new tab from current dir
{
osascript -e "
...

Bash Open a new tab in current d...

by macournoyer, October 04, 2007 18:07, 2 refactorings

Here's a small script I wro...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
var Rating = Class.create();
Rating.prototype = {
  initialize: function(element, rating, options) {
...

JavaScript Rating system for this site

by macournoyer, September 29, 2007 14:09, 3 refactorings

Here's the code of the rati...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
def self.requires_role(role)
...

Ruby On restful_authentication role...

by jamesgolick, September 27, 2007 10:41 Star_fullStar_fullStar_fullStar_full

So, I added this

F6eddf2f983d23c2d031e407852625e9 Talk
before_filter :login_required
...

Ruby restful_authentication role...

by jamesgolick, September 27, 2007 10:40, 7 refactorings

This is a couple of lines t...

F6eddf2f983d23c2d031e407852625e9 Talk
class Line
  def parse
    skip_line
...

Ruby On Arrow Code

by macournoyer, September 26, 2007 17:18 Star_full

Why not restructure everyth...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
task :extract_style do
  css = File.read 'public/stylesheets/code.css'
  css.gsub! "{\n", '{'
...

Ruby Extracting style from a CSS...

by macournoyer, September 25, 2007 21:18, 2 refactorings

Here's a Rake task I use to...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
def code
  puts 'cool'
...

JavaScript On Is this year a leap year?

by macournoyer, September 23, 2007 13:13 Star_fullStar_fullStar_fullStar_fullStar_full

Nice tip Gary! I didn't kno...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
class CodeFormatter
  cattr_reader :syntaxes
  @@syntaxes = Uv.syntaxes.sort
...

Ruby [FEATURE] Sections in code!

by macournoyer, September 22, 2007 08:44, No refactoring

Introducing a new feature: ...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
units = %w{ one two three four five six seven eight nine }

File.open('counter.txt', 'w') do |f|
...

Ruby On Sum string sizes

by macournoyer, September 21, 2007 10:13 Star_fullStar_fullStar_fullStar_fullStar_full

Welcome to the site Hampton...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk

JavaScript On Is this year a leap year?

by macournoyer, September 21, 2007 08:20

I'll try to add sections wi...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
def link_to_remote_with_spinner(title, options)
  element_id = options.delete(:id) || ('link_to_' + title.underscore.tr(' ', '_'))
  container_id = options.delete(:container_id) || element_id
...

Ruby On link_to_remote_with_spinner

by macournoyer, September 21, 2007 07:42

With the above code you cou...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
Dir["test/**/*_test.rb"].size.to_f / Dir["app/**/*.rb"].size.to_f

Ruby On Test file to code file ratio

by macournoyer, September 21, 2007 07:34

Nice! Or even shorter, with...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
Object.extend(Date.prototype, {
  isLeap: function(){
    var year = this.getFullYear();
...

JavaScript On Is this year a leap year?

by macournoyer, September 21, 2007 07:30

I'm pretty sure the last ye...

Bfec5f7d1a4aaafc5a2451be8c42d26a Talk
Dir.glob("test/**/*_test.rb").size.to_f / Dir.glob("app/**/*.rb").size.to_f

Ruby On Test file to code file ratio

by danielharan, September 21, 2007 07:22

Well, here is a more ruby w...

880cbab435f00197613c9cc2065b4f5a Talk
# Behave like +link_to_remote+, but shows a spinner while the request is processing.
#   link_to_remote_with_spinner 'Hi', :url => hi_path
# You can specify the spinner and the container to hide
...

Ruby link_to_remote_with_spinner

by danielharan, September 20, 2007 14:17, 5 refactorings

We use this utility interna...

880cbab435f00197613c9cc2065b4f5a Talk