1
2
3
4
<?php
function username($user_id = null) {
	!is_null($user_id) OR $user_id = current_user();
...

PHP On get username from database

by WHF, May 16, 2008 12:50

Untested but this is a funn...

Avatar Talk

Ruby On restful_auth

by davidhq, May 15, 2008 20:19

So this is how I'll leave i...

4057d36ea1505c263efbdbdc0bf511cd Talk
1
2
3
4
class User < ActiveRecord::Base
  include UniqueCodeGenerator

...

Ruby On restful_auth

by davidhq, May 15, 2008 20:18
4057d36ea1505c263efbdbdc0bf511cd Talk
1
2
3
4
class WhoIsQuery
    query = ARGV[0]
    puts "Querying whois with #{query} ..."
...

Ruby On Whois refactoring

by Jeremy Weiskotten, May 14, 2008 19:31

You can use Enumerable#any?...

5170ca260dbd2cdfd5a887a4dba7636f Talk

Ruby On restful_auth

by davidhq, May 14, 2008 18:35

rupert,

I agree... clash d...

4057d36ea1505c263efbdbdc0bf511cd Talk

Ruby On restful_auth

by rupert, May 14, 2008 14:35

I've had similar concerns a...

Fb1fc6f2eccd067a19b298d89235bfe0 Talk

Ruby On restful_auth

by davidhq, May 14, 2008 10:26

Thank you!

I agree with yo...

4057d36ea1505c263efbdbdc0bf511cd Talk
1
2
3
4
def make_activation_code
  self.activation_code = generate_code
  make_activation_code unless self.class.find_by_activation_code(activation_code).nil?
...

Ruby On restful_auth

by Rupert Voelcker, May 14, 2008 09:44

I can't see that raising an...

Fb1fc6f2eccd067a19b298d89235bfe0 Talk

Ruby On restful_auth

by davidhq, May 13, 2008 22:02

other way around ... :} I s...

4057d36ea1505c263efbdbdc0bf511cd Talk

Ruby On restful_auth

by davidhq, May 13, 2008 22:02

self.password_reset_code = ...

4057d36ea1505c263efbdbdc0bf511cd Talk

Ruby On RSS model method

by Deepak Gole, May 12, 2008 13:01

Thanks Roderic Green for yo...

51224bdd17878b3b19e8987e9bb336a2 Talk
1
2
3
4
def save_feed  
     @feed = FeedTools::Feed.open('http://losangeles.craigslist.org/apa/index.rss')
     @feed.items.each_with_index do |item,i| 
...

Ruby On RSS model method

by Roderic Green, May 12, 2008 10:51 Star_fullStar_fullStar_fullStar_full
517ffe2436880cf4bddd062d01f06278 Talk
1
2
3
4
	public boolean equals(Object obj)
	{
		if (this == obj)
...

Java On Equals Method

by sdjk, May 10, 2008 10:20

The above code only works w...

Avatar Talk

Ruby On Building a dynamic date range

by claytonlz, May 09, 2008 01:13

Fantastic!

E17d936d4535519716b6e810052feac5 Talk
1
2
3
4
  # Find all articles in the given date range based on the published_at field
  def self.find_archived(year, month=nil)
    if month.nil?
...

Ruby On Building a dynamic date range

by danielharan, May 09, 2008 00:53 Star_fullStar_fullStar_fullStar_fullStar_full

This version is a bit longe...

880cbab435f00197613c9cc2065b4f5a Talk
1
2
3
4
for ((i=1;i<=17;i+=1))
         do
                option=`more test.txt|awk -F' ' '{ print $'$i'}'`
...

Bash On For Loop using Awk

by roxannspencerolsen.blogspot.com, May 08, 2008 20:50

Solved...

Avatar Talk
1
2
3
4
using System;
using System.Collections.Generic;
using System.Linq;
...

C# On Pointers in C#

by Andre Steenveld, May 08, 2008 09:00

I have found the problem. I...

Avatar Talk
1
2
3
4
public boolean equals(Object obj)
{
    return obj instanceof Bus && equals((Bus)obj);
...

Java On Equals Method

by asdasd, May 07, 2008 15:08

this is safe, but cleaner, ...

Avatar Talk

JavaScript On Hex color between two colors

by Andre Steenveld, May 06, 2008 10:28

You are welcome. And thanks...

Avatar Talk
1
2
3
4
class Poll
  attr_accessor :question
  def initialize(question, answers=[])
...

Ruby On Rubyize this : 6th edition

by danielharan, May 04, 2008 00:11

System is a vile word in a ...

880cbab435f00197613c9cc2065b4f5a Talk
1
2
3
4
<?php
function username($user_id = null) {
	if(is_null($user_id)) $user_id = current_user();
...

PHP On get username from database

by Eljay, May 01, 2008 21:53 Star_fullStar_fullStar_fullStar_full
36d905a90bc68c7b416bde73cc924575 Talk

Ruby On Step-REST uuuuugly controller

by schof, May 01, 2008 16:47

I second the comments about...

Cfaf074970ce958900608fceaac38543 Talk
1
2
3
4
<?php
	function username($user_id = null) {
		$user_id = is_null($user_id) ? $user_id : current_user();
...

PHP On get username from database

by DevP, May 01, 2008 04:49

Are you sure you want to re...

F666265b69d7510f44a918ee3bc2dcf9 Talk

PHP On Message system IP-ban

by poensupespect, April 30, 2008 23:18

A good supervisor can ste...

3d4eeaae73e099895cffeedb7844a5ef Talk

JavaScript On Hex color between two colors

by Lucent, April 30, 2008 23:10

Beautiful! I noticed the su...

38daf62a7887b44454a78a37552b22e4 Talk