1 2 3
// container = element to put message into // text = what you want the message to say ...
JavaScript Ultra lightweight message &...
1 2 3 4
module Menus def self.getValidPositiveNumber ...
Ruby Good way to output menu wit...
What would be the best or a...
1 2 3 4
class ProductsController < ApplicationController helper_method :sort_column, :sort_direction ...
Ruby Moving Code from Controller...
Hi all,
I know that the c...
1 2 3 4
<?php /* Write your header.. */ ...
PHP Get Site Information with PHP
Hello coders,
I'll share...
1 2 3 4
module Menus class Main_Menu ...
Ruby Help with module?!
Hi Im working on a program ...
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 ...
Since path.exists and fs.st...
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...
I tried using array_walk to...
1 2 3 4
final private static Map<String,DataType> table=new HashMap <String,DataType>(); ///.. ...
Java Access HashMap key by value
Having a table with pairs o...
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
Hi, I'm sure this is the mo...
1 2 3 4
def format_category_list(sub_categories) count = sub_categories.count list = "" ...
Ruby Generating a list of 3 entr...
I have this function in my ...
1 2 3 4
def load_feeds #feed url po = 'http://feed.kennisnet.nl/Basisonderwijs' ...
Ruby Fetch and parse feeds with ...
Function to fetch and parse...
1 2 3 4
var message = "" if (XMLHttpRequest.responseText.length > 0) message = jQuery.parseJSON(XMLHttpRequest.responseText).error ...
JavaScript Double 'if'
How to make this code looks...
1 2 3 4
this is customer class using System; ...
C# help on refactoring this code
hi i need help in urgent to...
1 2 3 4
@cart = CartItem.sum(:quantity, :group => "cart_id") new_ids = [] @cart.each do |c| ...
Ruby Sum of the Column
What i want to do is, find ...
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
Is there some magic i don't...
1 2 3 4
(function () { if (!window.console) { window.console = {}; ...
JavaScript console.log for ie
I'm assuming jQuery is pres...
1 2 3 4
openid_mapping = { :email => ["email", "http://axschema.org/contact/email"], :name => ["fullname", "http://axschema.org/namePerson"] ...
Ruby Hash + Array refactor
This actually works but I w...
1 2 3 4
<script type="text/javascript"> document.onkeyup = KeyCheck; function KeyCheck(e){ ...
JavaScript Prevent Default not working.
I am attempting to add Prev...
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...
This is a rails action that...
1 2 3 4
using System; using System.Collections.Generic; using System.Linq; ...
C# ASP.NET MVC List Helper
The idea behind this helper...
1 2 3 4
function MapWrapper(containerId, userDefinedOptions) { MAPWRAPPER_SCOPE = this; ...
JavaScript Javascript googlemap wrappe...
I have written a googlemap ...
1 2 3 4
<?php
public function get_usd_value($date)
{
...
PHP What is bad in this code?
I know that variable naming...
1 2
hash = {} array.each { |key| hash[key] = func(key) }
Ruby How to make it more idiomatic?
Can you make this code more...
1 2 3 4
sum = 0 self.items.each { |item| sum += item.fragments.count } ...
Ruby Calculate sum of items in a...
I'm pretty sure I'm not doi...
1 2 3 4
class ItemsController < ApplicationController def create @product = Product.find(params[:product_id]) ...
Ruby Add product to cart, reject...
I've a simple cart applicat...
I've built a javascript/jQu...