This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code, create, and share | |
- create solutions to sore points | |
- reduce friction, stream line processes | |
- create projects that scratch an itch or ease some pain | |
- start contributing to official documentation efforts | |
- focus more on community and less on yourself | |
Remember, Code talks. | |
- Talk (and read) less, Code More | |
- If you want to run your own business, code is the perfect way to find cofounders and employees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (functionName, container){ | |
var index; | |
function log(){ | |
console.log(index); | |
} | |
function iterate(){ | |
log(); | |
if(index>1) setTimeout(iterate, 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// functional | |
var logCar = function (obj){ | |
return function(){ | |
"I'm a" + obj.color + " " + obj.make; | |
} | |
} | |
// Example call for functional version: | |
logCar({ color: 'blue', make: 'BMW' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var logCar = function (obj){ return "I'm a" + obj.color + " " + obj.make; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Write a class to support the following code: | |
var Person = function(name) { this.name = name; } | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); | |
thomas.name // --> "Thomas" | |
// 2. Add a getName() method to all Person objects, that outputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Part 1. | |
// Implement a function prototype extension that caches function results for | |
// the same input arguments of a function with one parameter. | |
// | |
// For example: | |
// Make sin(1) have the result of Math.sin(1), but use a cached value | |
// for future calls. | |
var sin = function() { return (arguments.length === 0) ? false : Math.sin(arguments[0]); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="the_div"> | |
<ul id="the_list"> | |
<li id="the_item">Click me!</li> | |
</ul> | |
</div> | |
<p id="log"></p> | |
<script type="text/javascript" charset="utf-8"> | |
function log(string){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ alert('later!'); }).delay(1); | |
// function is called 1 second later ^^ | |
Function.prototype.delay = function(seconds){ | |
setTimeout(this, seconds*1000); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function forEach(array, method) { | |
var l = {}; | |
for( l.ii = 1; l.ii <= arraylen(arguments.array); l.ii++ ) { | |
method(arguments.array[l.ii]); | |
} | |
} | |
function writeNow(str) { | |
writeOutput(str); | |
writeOutput('+'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery('#' + form_id).find(':input').each(function(i,e) { | |
// list of types to clear with default values | |
var obj = { | |
'text' : '' | |
, 'select-one': 0 | |
}; | |
if (obj[e.type] !== undefined) { | |
jQuery(e).val(obj[e.type]); | |
} | |
}); |