- (5 points) complete the drawTriangle function definition to get the desired output (5 points)
var drawTriangle = function(level) {
}
/** | |
* | |
* Base64 encode / decode | |
* http://www.webtoolkit.info/ | |
* | |
**/ | |
var Base64 = { | |
// private property | |
_keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", |
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
Array.prototype.move = function (old_index, new_index) { | |
if (new_index >= this.length) { | |
var k = new_index - this.length; | |
while ((k--) + 1) { | |
this.push(undefined); | |
} | |
} | |
this.splice(new_index, 0, this.splice(old_index, 1)[0]); | |
return this; // for testing purposes | |
}; |
function throttle(fn, delay) { | |
var timer = null; | |
return function () { | |
var context = this, args = arguments; | |
clearTimeout(timer); | |
timer = setTimeout(function () { | |
fn.apply(context, args); | |
}, delay); | |
}; | |
} |
$.fn.removeStyle = function(style) | |
{ | |
var search = new RegExp(style + '[^;]+;?', 'g'); | |
return this.each(function() | |
{ | |
$(this).attr('style', function(i, style) | |
{ | |
return style.replace(search, ''); |
Date.prototype.addDays = function(days) { | |
var dat = new Date(this.valueOf()); | |
dat.setDate(dat.getDate() + days); | |
return dat; | |
}; | |
function getDates(startDate, stopDate) { | |
var dateArray = []; | |
var currentDate = startDate; | |
while (currentDate <= stopDate) { |
This gist is a fork of the gist from this blog post.