Skip to content

Instantly share code, notes, and snippets.

View jrjames83's full-sized avatar

Jeff James jrjames83

View GitHub Profile
// Bonfire: Mutations
// Author: @fcc0208647c
// Challenge: http://www.freecodecamp.com/challenges/bonfire-mutations#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function mutation(arr) {
firstElement = arr[0].toLowerCase().split('');
secondElement = arr[1].toLowerCase().split('');
for (var i=0; i<secondElement.length; i++) {
// Bonfire: Falsy Bouncer
// Author: @fcc0208647c
// Challenge: http://www.freecodecamp.com/challenges/bonfire-falsy-bouncer#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function bouncer(arr) {
trues = arr.filter(Boolean);
return trues;
// Bonfire: Seek and Destroy
// Author: @fcc0208647c
// Challenge: http://www.freecodecamp.com/challenges/bonfire-seek-and-destroy#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function destroyer(arr) {
var slicedArgs = Array.prototype.slice.call(arguments, 1);
console.log(slicedArgs + " are my args");
mylist = arguments[0];
// Bonfire: Where do I belong
// Author: @fcc0208647c
// Challenge: http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong#
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function where(arr, num) {
myarr = arr.sort(function(a,b) {return a - b;});
console.log(myarr);
minval = Math.min.apply(Math, myarr);
maxval = Math.max.apply(Math, myarr);
// Bonfire: Sum All Numbers in a Range
// Author: @fcc0208647c
// Challenge: http://www.freecodecamp.com/challenges/bonfire-sum-all-numbers-in-a-range
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function sumAll(arr) {
arr.sort();
start = Math.min.apply(Math, arr);
end = Math.max.apply(Math, arr);
// Bonfire: Diff Two Arrays
// Author: @fcc0208647c
// Challenge: http://www.freecodecamp.com/challenges/bonfire-diff-two-arrays
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function diff(arr1, arr2) {
arr3 = arr1.concat(arr2);
final = arr3.filter(function(val, index, arr){
console.log(arr3.indexOf(val),arr3.lastIndexOf(val),val);
@jrjames83
jrjames83 / urls.py
Created January 12, 2016 06:03
Reverse for 'password_change_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Reverse for 'password_change_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
Make sure in your main urls.py folder you include: or else this error may persist.
urlpatterns = [
url('^', include('django.contrib.auth.urls')),
if (document.getElementsByClassName("HeaderPrice")[0]) {
var rooms_avail_omtr = document.getElementsByClassName("HeaderPrice").length;
s.eVar51 = rooms_avail_omtr;
} else if (jQuery('.NoAvailMsg')[0]) {
s.eVar51 = "No Results Available";
} else {
s.eVar51 = "Some Other Condition Has Occurred";
var data = [
{
"_id": "56db20d2d9944c0932ecd1c8",
"index": 0,
"guid": "e054234d-c7ab-4e50-bf5b-b30dc93397ab",
"isActive": false,
"balance": "$1,172.10",
"picture": "http://placehold.it/32x32",
"age": 27,
"eyeColor": "green",
@jrjames83
jrjames83 / adwords_bid.js
Created March 15, 2016 04:15
adwords keyword bidding skeleton
function main() {
// Set-up dates for lookback period control
//
Number.prototype.padZero= function(len){
var s= String(this), c= '0';
len= len || 2;
while(s.length < len) s= c + s;
return s;
}