#!/usr/bin/env ruby1.8 # # p0wn1e is the hackerspaces.org notifier. ...
def date_range_by_week(selected_date) first_in_calendar = selected_date.beginning_of_month.next_week(:monday) - 7 (first_in_calendar...(first_in_calendar+7*6)).to_a.in_groups_of(7) ...
Ruby On Splitting array into define...
by Marc-Andre,
March 25, 2009 17:44
And if you don't need those...
def offset(selected_date) wday = selected_date.beginning_of_month.wday wday == 0 ? 6 : (wday - 1) ...
Ruby On Splitting array into define...
by Marc-Andre,
March 25, 2009 17:26
I'm presuming you're coding...
Ruby On Converting all umlaut chara...
by Marc-Andre,
March 17, 2009 19:52
@Tj: Bit-shifting? For all ...
class Asset < ActiveRecord::Base belongs_to :account belongs_to :asset_type ...
Ruby On Advanced search form & ...
by Marc-Andre,
March 17, 2009 15:45
I'd use a naming convention...
class String # returns an array of unicode codepoints, in canonical order def split_codepoints ...
Ruby On Converting all umlaut chara...
by Marc-Andre,
March 17, 2009 14:48
There are way more accents ...
var next = false;
for (var i = 0; i < el.options.length; i++) {
if (next) {
...
JavaScript Check next option in select...
by Dmitry Polushkin,
January 25, 2009 15:04,
5 refactorings, tagged with select, options, increment, next
Could be written in plain j...
Ruby On While loop to get unique value
by Dmitry Polushkin,
January 22, 2009 10:06
What about magic number '8'?
def create_vouchercode
begin
self.vouchercode = generate_vouchercode(8)
...
Ruby On While loop to get unique value
by Marc-Andre,
January 13, 2009 01:49
...and if you favor using a...
# Add this to spec/spec_helper.rb # Use as: # check_route_for(:route_name => 'foo', :route_path => '/foo/:bar/baz/:quuq', :controller => 'foo', :action => 'foos', :bar => 'BAR', :quux => 'Moo') ...
Ruby On Conversion from the 2d arra...
by Dmitry Polushkin,
October 22, 2008 18:21
Something like I have writt...
Ruby On Conversion from the 2d arra...
by Dmitry Polushkin,
October 22, 2008 14:24
@danielharan: is it faster ...
Ruby On Conversion from the 2d arra...
by Dmitry Polushkin,
October 22, 2008 14:17
Thanks! Why no "to_h" metho...
class Array
def to_h
hash = {}
...
Ruby Conversion from the 2d arra...
Conversion from the 2d arra...
Ruby On Open hours grouping
by Dmitry Polushkin,
October 16, 2008 06:20
I have some idea how to imp...

I want to refactor this cod...