This file contains hidden or 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 countdown = (function() { | |
| var index; | |
| function log(){ | |
| console.log(index); | |
| } | |
| function iterate(){ | |
| log(); | |
| if(index>1) setTimeout(iterate, 1000); |
This file contains hidden or 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. | |
| // | |
| // Part 2. | |
| // Use this new function to refactor the code example. |
This file contains hidden or 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 thomas = new Person('Thomas'); | |
| // var amy = new Person('Amy'); | |
| // | |
| // thomas.name // --> "Thomas" | |
| // 2. Add a getName() method to all Person objects, that outputs | |
| // the persons name. |
This file contains hidden or 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> | |
| <!-- | |
| 1. Change the addEventListener calls so that the events occur in the following order. |
This file contains hidden or 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
| sprocketize -C /Users/dave/code/Python/django-sites/hae/content/js -I hae -I vendor hae.js > /Users/dave/code/Python/django-sites/hae/content/js/sprockets.js |
This file contains hidden or 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
| //= require "vendor/prototype.s2" | |
| HAE = { | |
| } | |
| //= require "hae/attorney" | |
| //= require "hae/hiringagency" | |
| document.observe('dom:loaded', function() { | |
| Element.addMethods({ |
This file contains hidden or 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
| import subprocess, shlex | |
| import os | |
| def sprocketize(): | |
| try: | |
| import shlex, subprocess | |
| js_path = os.path.abspath(os.path.join(os.getcwd(), '../content/js')) | |
| sprocketize = "sprocketize -C %s -I hae -I vendor hae.js > %s/sprockets.js" % ( | |
| js_path, | |
| js_path |
This file contains hidden or 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
| kicker -e "sprocketize -C /Users/dave/code/Python/django-sites/hae/content/js -I hae -I vendor hae.js > /Users/dave/code/Python/django-sites/hae/content/js/sprockets.js" /Users/dave/code/Python/django-sites/hae/content/js |
This file contains hidden or 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
| import os, subprocess, shlex | |
| def start_kicker(): | |
| ''' | |
| Kick off Kicker and pass it our | |
| sprocketize command-line argument | |
| ''' | |
| try: | |
| js_path = os.path.abspath(os.path.join(os.getcwd(), '../content/js')) | |
| sprocketize = "sprocketize -C %s -I hae -I vendor hae.js > %s/sprockets.js" % ( |
This file contains hidden or 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
| # | |
| # | |
| def create_table_for_unrelated_model(model, database_name): | |
| from django.db import connections, transaction | |
| from django.core.management.sql import custom_sql_for_model | |
| from django.core.management.color import no_style | |
| connection = connections[database_name] | |
| cursor = connection.cursor() | |
OlderNewer