def check_condition(condition, item)
case condition.attribute
when :author
...
/* user properties */ var url = "zingmw"; /* user properties end */ ...
JavaScript Zing JS with AJAX requests
by https://www.google.com/accounts/o8/id?id=AItOawlqFL8_2UJb8WgR5uKKAHl4uXBvgRVIslY,
March 15, 2012 06:08,
2 refactorings, tagged with ajax, interface, facade
The script is included in p...
#include <stdio.h> #include <stdlib.h> #include <string.h> ...
C Linux Shell
by https://www.google.com/accounts/o8/id?id=AItOawlNfH_H9Dh2QVh-Bdy_aEjJwD8hgAyN1ZE,
March 14, 2012 21:39,
1 refactoring, tagged with linux c
This is for a class. I have...
internal static class PasswordSaltAndHash
{
...
C# password salt and hash
by https://www.google.com/accounts/o8/id?id=AItOawkvSzcZPVNSb5mjYOwoEqyN3vwh1shcI84,
March 13, 2012 15:08,
8 refactorings, tagged with encryption, database, security, password, salt and hash
Is this valid and secure to...
# Calculate the financial year, with the supplied date
def get_financial_year(opts={})
date = opts[:date].is_a?(Date)? opts[:date] : Time.now.to_date
...
Ruby Getting financial year
by https://www.google.com/accounts/o8/id?id=AItOawkXhagloEt9LaGYb5TnfYmraHmMC8fzlsE,
March 12, 2012 22:47,
6 refactorings, tagged with rails, ruby, date
I'm trying to get the finan...
var Controller, Core, Model, Model_Event, View, Controller_Index,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = Object.prototype.hasOwnProperty,
...
JavaScript One Page Application
I've recently been developi...
puts "is fruit" if (ARGV.first == 'apple') or (ARGV.first == 'banana')
Ruby conditional with many options
by https://www.google.com/accounts/o8/id?id=AItOawmZJnddTlys_mqBLOfhHu5DhAYubKj1EwY,
March 07, 2012 23:00,
3 refactorings, tagged with conditionals options ruby-1.9.2
Is it not possible to write...
This is the Python code: def paths_rec(path,edges): ...
Python Validating a small code fro...
by melsi-habipi.myopenid.com,
March 05, 2012 02:38,
2 refactorings, tagged with python php graph theory
Hello,
I have written a ...
//actual code
if(strpos($name, 'is') === 0)
{
...
PHP Substring based on found st...
Ok so this code removes is ...
if current_user.requested_friends.exists?(params[:friend_id]) or current_user.pending_friends.exists?(params[:friend_id]) or current_user.friends.exists?(params[:friend_id])
Ruby If statement with many OR o...
by https://me.yahoo.com/a/hrHoLLx8w4O8IV2uFy1jAKJ7B702_qruWPI-,
February 21, 2012 14:01,
8 refactorings, tagged with ruby, rack
I would like to refactor th...
$target.hasClass('widgettitle') ||
$target.hasClass('ui-icon-minus') ||
$target.hasClass('ui-icon-plus') ? actionOptions['toggleWidgetContent']() :
...
JavaScript Can this be improved?
by https://www.google.com/accounts/o8/id?id=AItOawmrAARXAU70eBdo7cU4o7zzc2MFl1jwFnc,
February 17, 2012 15:23,
4 refactorings, tagged with javascript, jquery, jquery ui
I'm wondering if this compa...
def fetch(subjects = current_subjects, queue = QUEUES)
subjects.each do |s|
...
Ruby three into one
I want to turn these three ...
def test_condition(condition, item, test_item) case condition.query ...
Ruby One or two methods?
Help me improve this, it wo...
import sys,functools def multi_triggered(contat,lamb): ...
Python multi triggered decorator
by https://www.google.com/accounts/o8/id?id=AItOawmTNf4OM_K2oKIswc_Gh7lbXIlIGDi0Piw,
February 13, 2012 07:40,
No refactoring, tagged with decorator, triggered
Implements a parametric dec...
const int MAX_PARTICLES = 16; const int MAX_PARTICLE_SPEED = 3; const int PARTICLE_FRAMES = 120; ...
C Simple Particle Engine for ...
by https://www.google.com/accounts/o8/id?id=AItOawl3BeAhTXKYDpKI7ld64fgVwaukoKGEuUo,
February 08, 2012 21:55,
5 refactorings, tagged with game, C, struct
This took several hours ove...
@all_brands = Brand.find(:all).map(&:name).sort_by{|x| (-1)*x.id.length}
@line_items = LineItem.find(:all) # I cannot use database filter by brand here (NOSQL DB)
@all_brands.each_with_index do |brand, ind|
...
Ruby Please improve
by https://www.google.com/accounts/o8/id?id=AItOawlHZN6xya-P41xmvSHLey27wdmmgvG24aM,
February 08, 2012 01:11,
5 refactorings, tagged with ruby
In this piece of code I ass...
------- #shplaying.php file ...
PHP Parsing of XML data has hig...
by mattlax.myopenid.com,
February 04, 2012 19:32,
6 refactorings, tagged with speed, php, curl, cpu, debug
This script simply retrieve...
var MyNamespace = MyNamespace || {};
MyNamespace.BingMap = {
BingMapCredentials: 'xxxxxxxxx', // should be a default setting (null)
...
JavaScript Convert simple Javascript t...
by Chase Florell,
February 04, 2012 09:12,
3 refactorings, tagged with javascript, jquery, bing maps
I've been working on a simp...
class Company has_many :stores end ...
Ruby Active Record getting uniqu...
by kibyegn.myopenid.com,
February 03, 2012 01:40,
1 refactoring, tagged with rails, short clean ruby, active record
I still think I could make ...
layouts = Dir.glob("_layouts/*")
layouts.each do |layout|
layout.gsub!(/^_layouts\/(.*)\..*$/, '\1')
...
Ruby List the files in a directo...
The title says it all, I'm ...
Weeks = [["2012-01-15","2012-01-22"], ["2012-01-22","2012-01-29"], ["2012-01-29","2012-02-05"],["2012-02-05","2012-02-12"], ["2012-02-12","2012-02-19"], ["2012-02-19","2012-02-26"]] ...
Ruby clean the code
by https://www.google.com/accounts/o8/id?id=AItOawlaTnwjQ00W1XCRaUEGIonvKgruTMebfak,
January 30, 2012 03:54,
4 refactorings, tagged with ruby, rails 3
Plz help me clean the code
...
Favour specialises in Affordable OHS Software, Recruitment Management & HR Software. We provide solutions to your OH&S and Human Resources functionality and capabilities. Visit us today to see how we can help you!
Bash ohs system, recruitment sof...
by bookerbrinley.myopenid.com,
January 28, 2012 04:46,
No refactoring, tagged with HR Software, OHS Software, OH&S Software, Recruitment Software, Human Resources Software, OHS System
Favour specialises in Affor...
M = [["a", "b"], ["c", "d"], ["e", "f"]] x = [] ...
Ruby Array parsing in a block
by https://www.google.com/accounts/o8/id?id=AItOawmWMRp7fAci9domcwhxD3fNikoTak9bkYc,
January 26, 2012 05:59,
1 refactoring, tagged with arrays, blocks, loops, array syntax
x should be ["a","c","e"] i...
I want to avoid extending t...