1
2
3
// container = element to put message into
// text = what you want the message to say
...

JavaScript Ultra lightweight message &...

by Chad Thiele, September 01, 2010 04:34, 1 refactoring, tagged with jQuery lightweight notification function

I've built a javascript/jQu...

Ca2df82ec22313fcd37c67b048235fd2 Talk
1
2
3
4
module Menus
  
 def self.getValidPositiveNumber
...

Ruby Good way to output menu wit...

by tragicdancer.myopenid.com, August 30, 2010 17:28, 1 refactoring, tagged with ruby

What would be the best or a...

Avatar Talk
1
2
3
4
class ProductsController < ApplicationController  
  helper_method :sort_column, :sort_direction
  
...

Ruby Moving Code from Controller...

by Omer Jakobinsky, August 30, 2010 12:22, No refactoring, tagged with rails

Hi all,
I know that the c...

A289beedc9fd9fdeaaa905bd755f6f98 Talk
1
2
3
4
<?php

/* Write your header.. */
...

PHP Get Site Information with PHP

by jackoder.myopenid.com, August 27, 2010 16:50, 1 refactoring, tagged with php, get information

Hello coders,

I'll share...

Bd779de8a3e7524c5e4c21f2940545fd Talk
1
2
3
4
module Menus
  
  class Main_Menu
...

Ruby Help with module?!

by tragicdancer.myopenid.com, August 26, 2010 11:48, 3 refactorings

Hi Im working on a program ...

Avatar Talk
1
2
3
4
filesize_done = 0;
path.exists(filename + "." + 0, function(exists) {
  fs.stat(filename + "." + 0, function(err, stat) {
...

JavaScript Node.js: Calculating total ...

by https://www.google.com/accounts/o8/id?id=AItOawnmwk5vEpvcV26edzd-Y_LguXrbu-o4BVI, August 25, 2010 23:55, 2 refactorings

Since path.exists and fs.st...

Avatar Talk
1
2
3
4
<?php
foreach($final as $key => $val) {
    if (is_array($val) && count($val) == 1) $final[$key] = $val[0];
...

PHP convert single itemed sub-a...

by paulswansea.myopenid.com, August 25, 2010 20:45, No refactoring, tagged with php, multidimensional-array, 2d array

I tried using array_walk to...

E4bd1595f34e7e03765eda6ed65bf6bb Talk
1
2
3
4
    final private static Map<String,DataType>  table=new HashMap <String,DataType>();
    
    ///..
...

Java Access HashMap key by value

by hernan, August 25, 2010 15:16, 2 refactorings, tagged with speed java

Having a table with pairs o...

6d8683e91f686075acf2abc6c87b6354 Talk
1
2
3
4
<% if I18n.locale == :pl %>
    <%= link_to 'PL', { :locale => :pl }, :class => "language_selected" %> | <%= link_to 'ENG', { :locale => :en } %>
<% else %>
...

Ruby Language Selection

by Omer Jakobinsky, August 25, 2010 10:47, 3 refactorings, tagged with ruby, rails

Hi, I'm sure this is the mo...

A289beedc9fd9fdeaaa905bd755f6f98 Talk
1
2
3
4
  def format_category_list(sub_categories)
    count = sub_categories.count
    list = ""
...

Ruby Generating a list of 3 entr...

by KJF, August 24, 2010 11:15, 2 refactorings, tagged with rails

I have this function in my ...

A529b78031f700ca2005bdbd1af5ee7b Talk
1
2
3
4
def load_feeds 
  #feed url
  po = 'http://feed.kennisnet.nl/Basisonderwijs'
...

Ruby Fetch and parse feeds with ...

by https://www.google.com/accounts/o8/id?id=AItOawmdo5pHB7lc_C5OJPTw3EPT2380GAzewqU, August 23, 2010 22:18, 2 refactorings, tagged with feedzirra

Function to fetch and parse...

Avatar Talk
1
2
3
4
var message = ""
if (XMLHttpRequest.responseText.length > 0)
  message = jQuery.parseJSON(XMLHttpRequest.responseText).error
...

JavaScript Double 'if'

by AlekSi, August 23, 2010 14:32, 6 refactorings, tagged with if

How to make this code looks...

Af19cd0c0141bf7d6b42516706eb1d1d Talk
1
2
3
4
this is customer class

using System;
...

C# help on refactoring this code

by https://me.yahoo.com/a/TFeqsehzisgexP.ujZQSS.TAkEVkMHk-, August 23, 2010 05:36, 1 refactoring

hi i need help in urgent to...

Avatar Talk
1
2
3
4
@cart = CartItem.sum(:quantity, :group => "cart_id")
new_ids = []
@cart.each do |c|
...

Ruby Sum of the Column

by Paddy, August 21, 2010 13:49, 5 refactorings

What i want to do is, find ...

6de3daa3f91b7169c85df7702b4fb1d4 Talk
1
2
3
4
uri = URI.parse(the_uri)
hash = CGI.parse(uri.query)
hash["size"] = size.to_s
...

Ruby Set value of key in uri

by Hakon1, August 21, 2010 10:59, 5 refactorings, tagged with rails

Is there some magic i don't...

3764c38cac5f613c92a87b8c3813a3ad Talk
1
2
3
4
(function () {
    if (!window.console) {
        window.console = {};
...

JavaScript console.log for ie

by lawoffives.blogspot.com, August 20, 2010 15:14, 1 refactoring, tagged with javascript, console

I'm assuming jQuery is pres...

9803fa03938ea54a15ed1954996b1e5c Talk
1
2
3
4
openid_mapping = {
  :email => ["email", "http://axschema.org/contact/email"], 
  :name => ["fullname", "http://axschema.org/namePerson"]
...

Ruby Hash + Array refactor

by Oriol, August 19, 2010 17:56, 3 refactorings, tagged with ruby, hash, array, openid, sreg, axschema

This actually works but I w...

E4679be8d7d2484f9c0b8c4df71f4d2a Talk
1
2
3
4
<script type="text/javascript">
	document.onkeyup = KeyCheck;       
	function KeyCheck(e){
...

JavaScript Prevent Default not working.

by Anri, August 19, 2010 16:03, 2 refactorings, tagged with javascript

I am attempting to add Prev...

4058d6b5dc2bfd92fd7f7f9a13eb61a6 Talk
1
2
3
4
def images
  image = Kernel.const_get(params[:class].capitalize).find_by_link(params[:id]).image
  if image.nil?
...

Ruby Rails DB Field to Image Out...

by https://www.google.com/accounts/o8/id?id=AItOawkuoairsv4fB9xuwKcC953iLBxlElFcjEA, August 18, 2010 22:19, 2 refactorings

This is a rails action that...

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

C# ASP.NET MVC List Helper

by jmcd, August 18, 2010 20:42, 6 refactorings, tagged with C#, asp.net-mvc

The idea behind this helper...

493e6c6fc3f24eb73295548cfd136574 Talk
1
2
3
4
function MapWrapper(containerId, userDefinedOptions) {

	MAPWRAPPER_SCOPE = this;
...

JavaScript Javascript googlemap wrappe...

by basit74.myopenid.com, August 18, 2010 12:39, No refactoring, tagged with javascript

I have written a googlemap ...

40f83fc990800c254b7c51f700cad710 Talk
1
2
3
4
<?php
    public function get_usd_value($date)
    {
...

PHP What is bad in this code?

by https://www.google.com/accounts/o8/id?id=AItOawk89fkb9x-moiNmY07jOpKHwIT1tUTiK6M, August 17, 2010 15:53, 1 refactoring, tagged with php, array, array string loop each

I know that variable naming...

144314100b686db946ff68c7ae1065d1 Talk
1
2
hash = {}
array.each { |key| hash[key] = func(key) }

Ruby How to make it more idiomatic?

by AlekSi, August 16, 2010 11:58, 6 refactorings, tagged with ruby, idiomatic, idioms

Can you make this code more...

Af19cd0c0141bf7d6b42516706eb1d1d Talk
1
2
3
4
sum = 0
self.items.each { |item| sum += item.fragments.count }
      
...

Ruby Calculate sum of items in a...

by FRKT, August 16, 2010 08:12, 4 refactorings, tagged with array hash

I'm pretty sure I'm not doi...

28e9d19f948f2367b2da007e7ad858fd Talk
1
2
3
4
class ItemsController < ApplicationController
  def create
    @product = Product.find(params[:product_id])
...

Ruby Add product to cart, reject...

by Arivudainambi, August 14, 2010 09:01, 2 refactorings, tagged with rails, efficiency

I've a simple cart applicat...

37f51e0d0c7a647a45c89fdf96cb4b37 Talk