Skip to content

Instantly share code, notes, and snippets.

## AJAX:
text = $('#URL').val()
$.ajax
url: ($ this).data 'update-path'
type: 'POST'
data:
url: text
dataType: 'script'
# Controller:
@cmwelsh
cmwelsh / gist:1714577
Created February 1, 2012 02:09 — forked from anonymous/gist:1714483
tyebud - pastebin.com/fhFTB3SH
function forEach(array, action) {
for (var i = 0; i < array.length; i++)
action(array[i]);
}
function sum(numbers) {
var total = 0;
function numberProcessor(number) {
total += number;