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
// 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'); | |
console.log(thomas.name) // --> "Thomas" |
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
// Exercise 1 - OO || !OO | |
// Define a data structure for cars (make and color), and a function | |
// that logs a string like "I'm a red Mercedes" to the console. | |
// Make two versions: a functional version, and a object-oriented version. | |
var logCar = function(car) { | |
console.log("I'm a " + car.color + ' ' + car.make); | |
} | |
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
// Exercise 2 - Closures | |
// Wrap the following code in a closure and export only the "countdown" function. | |
var countdown = function() { | |
// Code | |
var index; | |
function log(){ | |
console.log(index); | |
} |
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
// taken from http://www.dreamincode.net/code/snippet154.htm | |
// | |
// Find the weaknesses, and clean up the code. | |
// Find at least 3 things you can make better! | |
// | |
// Test numbers (return true): | |
// 4111111111111111 | |
// 378282246310005 | |
// 5555555555554444 |
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/log/lighttpd/*.log { | |
missingok | |
copytruncate | |
rotate 7 | |
compress | |
notifempty | |
sharedscripts | |
postrotate | |
/etc/init.d/lighttpd reload | |
endscript |
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
/Library/Application\ Support/Titanium/sdk/osx/1.1.0/tibuild.py -d ~/tmp -n -t bundle -a /Library/Application\ Support/Titanium/sdk/osx/1.1.0/ ~/Projects/Titanium\ Studio\ Workspace/MyApp |
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
$ /Library/Application\ Support/Titanium/sdk/osx/1.1.0/tibuild.py | |
Usage: tibuild.py [options] appdir | |
Options: | |
--version show program's version number and exit | |
-h, --help show this help message and exit | |
-d FILE, --dest=FILE destination folder for output | |
-v, --verbose turn on verbose logging | |
-o PLATFORM, --os=PLATFORM |
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
trying to get property of non-object | |
invalid request token |