1
2
3
4
#!/bin/ruby

characters_to_use="ABCD"
...

Ruby brute-force password cracker

by Nathan, October 10, 2008 22:29, 1 refactoring, tagged with password, brute-force, crack, combination, permutation

Just a quick-and-dirty for ...

D5145c421cd25af6fa577c15219add90 Talk
1
2
3
4
  def translation_links
    lang = [
      %w[en english us], 
...

Ruby nested array to set of html...

by seaofclouds, October 09, 2008 07:51, 2 refactorings, tagged with ruby, array, hash, translation

i have a simple array that ...

F55e8e113669f6ea7d1d99f38907ce54 Talk
1
2
3
4
WEEKDAYS = %w(mon tue wed thu fri sat sun)

dates = [
...

Ruby Open hours grouping

by Dmitry Polushkin, October 08, 2008 09:13, 1 refactoring, tagged with grouping, hours, weekdays

Actually I really don't kno...

832ed6ace46d61032151f4e1864c057f Talk
1
2
3
4
class SearchNestedHashByValue
  def key_for(h, str, trail=[])
    h.each_pair do |k, v|
...

Ruby Search nested hash

by jnstq, October 07, 2008 21:47, 1 refactoring, tagged with i18n

Search nested hash on their...

A4d90c6fe98bfe0b491c277c3e687031 Talk
1
2
3
4
#controller  
def search
    if params[:search]
...

Ruby Search with fulltext, ago-c...

by papricek.myopenid.com, October 07, 2008 12:52, 3 refactorings

How would you make this cod...

B04a553de1b8b45433b841bba440cc42 Talk
1
2
3
4
def writefile(file, *linedata)
	linedata.each do |line| 	
		file << line.join(",") + "\n"
...

Ruby Parsing non-delimited text

by thepanu, October 06, 2008 07:48, 1 refactoring, tagged with parsing, non-delimited, regexp, csv

I have large text-reports f...

98edd841bbc19903cd758722d9745f0b Talk
1
2
3
4
def redirect_to_current_user
  if params[:id] != current_user.login
    if params[:action] == "show"
...

Ruby Before Filter URL Redirect ...

by TimK, September 30, 2008 00:18, 5 refactorings, tagged with rails

I'm using to_param to pass ...

2722012beb9afcad75df5c9f2229fd8c Talk
1
2
3
4
$LETTER = Hash[*%w/
A .- N -.
B -... O ---
...

Ruby Morse Code Encoder/Decoder

by Druwerd, September 29, 2008 05:21, 4 refactorings, tagged with morse code

I'm trying to improve my Ru...

6ae6663a1fc5b44960f27be9d4a6f19c Talk
1
2
3
4
#!/usr/bin/env ruby

# == Synopsis
...

Ruby Source code analysis

by Tj Holowaychuk, September 26, 2008 03:04, 3 refactorings

Small class to analyze scri...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
module CLI
  class Session 
    
...

Ruby Interactive CLI Session

by Tj Holowaychuk, September 23, 2008 16:06, 3 refactorings, tagged with cli shell

Again I am a Ruby newb (two...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
  #
  # Format filesize.
  #
...

Ruby Format Filesize

by Tj Holowaychuk, September 22, 2008 15:40, 3 refactorings, tagged with filesize format

Ruby-newb coming through. I...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
  
  #
  # Convert a string to CamelCase.
...

Ruby Camelize

by Tj Holowaychuk, September 22, 2008 15:38, 7 refactorings, tagged with camelcase

I am pretty new to Ruby (on...

F1e3ab214a976a39cfd713bc93deb10f Talk
1
2
3
4
FIELDS = [ 'first', 'last',      'band' ]
DATA   = [['Kurt',  'Cobain',    'Nirvana'],
          ['Jimi',  'Page',      'Led Zeppelin'],
...

Ruby Map fields array and data a...

by charlesroper, September 22, 2008 15:23, 9 refactorings, tagged with array, hash

First posting here. I just ...

93fc84c261cdce2e2f1d64c8e531ecb7 Talk
1
2
3
# Simple method to calculate the square of a number
...

Ruby Conditional Assignment

by ruphin.myopenid.com, September 21, 2008 15:01, 15 refactorings, tagged with ruby, assignment

This is a tiny bit of code ...

C54b1538124ee5c6f3af5f628e1750dc Talk
1
2
3
4
class RSExp

	def equate(xp)
...

Ruby Cleaner Ruby

by codvious, September 20, 2008 03:43, 5 refactorings, tagged with ruby

Noob to Ruby here. Any way ...

E0dabbf83e6c56adc987e069e4b83a2b Talk
1
2
3
4
class Listing < ActiveRecord::Base
  require_dependency "listing/property_related"
  require_dependency "listing/price_related"
...

Ruby require_dependency

by Tien Dung, September 18, 2008 01:08, 3 refactorings

Rails require_dependency usage

5071c5b861341c0dcfcf6ac86327701f Talk
1
2
3
4
		for feedback in @feedbacks
			unless feedback.question1.nil?
				data[0][feedback.question1.to_i - 1] += 1
...

Ruby Horrible loop

by toggo.myopenid.com, September 17, 2008 09:51, 5 refactorings

Can anyone help refactor th...

Avatar Talk
1
2
3
4
# 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
1
2
3
4
x = 'My String'

x.kind_of? String # => true
...

Ruby x.kind_of? MyClass or x.cla...

by phylae.myopenid.com, September 10, 2008 03:58, 5 refactorings, tagged with class, kind_of?

It seems like these two are...

20bdcaa65891ace11f18e393c6e1f729 Talk
1
2
3
<%= link_to 'New page', new_page_path %>
...

Ruby Sorting a navigation tree u...

by nathan, September 08, 2008 21:06, 3 refactorings, tagged with rails fat controller

I have something, working r...

B4ec694f9d955bee753559037aa1805a Talk
1
2
3
4
def custom_pagination(num_item, per_page, current_page)
  num_page = (num_item/per_page.to_f).ceil
  arr_page = []
...

Ruby ActiveRecord object custom ...

by Dimas, September 07, 2008 17:41, 1 refactoring, tagged with Custom Pagination

Hello everybody,

I'm beg...

F9ce5006fcc64833ce5f28b3b9b257f3 Talk
1
2
3
feed = RssParser.run("http://ws.audioscrobbler.com/1.0/user/me/recenttracks.rss")
  song1 = feed[:items][0][:title]
...

Ruby Think this needs a loop

by juo100@gmail.com, September 06, 2008 19:54, 3 refactorings, tagged with ruby, loop, noob

Im new to Ruby, I think it ...

B543a43dc8cb0aae562278484db60d25 Talk
1
2
3
4
module Enumerable
  # Sorts the enumeration by mapping the
  # values in the enumeration through the given block.
...

Ruby sort_by_multiple

by Sporkmonger, September 05, 2008 13:11, 12 refactorings, tagged with speed, sorting

require "benchmark"
data_s...

56ee28134dd0776825445e3551979b14 Talk
1
2
3
4
  def time_summary(klass,group_operator,field,from,to,step)
    data_with_missing_counts(klass.find(
      :all, 
...

Ruby Rails Active Record Time Su...

by sebastiana.myopenid.com, September 03, 2008 14:31, 2 refactorings, tagged with rails, chart, sumary

Give a count or sum group o...

Avatar Talk
1
2
3
4
#!/usr/bin/ruby
DVD_SIZE=4294967296
CD_SIZE=734003200
...

Ruby DVD Directory Archiver

by seal-7.blogspot.com, September 03, 2008 14:26, No refactoring, tagged with bash, shell, spaghetti, monkey patch

Originally made to move cal...

Avatar Talk