Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| .PHONY: test | |
| test: | |
| @ echo ### App Server Starting; echo | |
| @ node app.js >> tst_log.txt 2>&1 & | |
| @ echo; echo '### Running Zombie Tests'; echo | |
| @ sleep 1; node test-http/zombie_tests.js |
| # 2011, andyvanee | |
| from Foundation import * | |
| from AppKit import * | |
| from Cocoa import * | |
| class LockboxAppDelegate(NSObject): | |
| configPanel = objc.IBOutlet() | |
| srcFolder = objc.IBOutlet() | |
| destFolder = objc.IBOutlet() |
| require 'active_record' | |
| require 'yaml' | |
| require 'mysql' | |
| require 'logger' | |
| task :default => :migrate | |
| desc "Migrate the database through scripts in db/migrate. Target specific version with VERSION=x" | |
| task :migrate => :environment do | |
| ActiveRecord::Migrator.migrate('db/migrate', ENV["VERSION"] ? ENV["VERSION"].to_i : nil ) |
| <h1>Basic Form Template</h1> | |
| {form for=$my_form} | |
| <!-- this is a hidden field --> | |
| {$id.html} | |
| <!-- Default rendering of the field --> | |
| <p> | |
| {if $cms_headline.error}{$cms_headline.error} <br>{/if} | |
| {$cms_headline.label} <br> | |
| {$cms_headline.html} |
| CKEDITOR.editorConfig = function( config ) { | |
| // http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.toolbar | |
| config.toolbar = [ | |
| ['Source', '-', 'Cut', 'Copy', 'PasteText', 'Link', 'Unlink'], | |
| ['Bold', 'Italic', 'NumberedList', 'BulletedList'], | |
| ['HorizontalRule', 'Table', 'Outdent', 'Indent', 'RemoveFormat'], | |
| ['Format', 'FontSize'] | |
| ]; | |
| config.uiColor = '#CCC'; | |
| config.skin = 'kama'; |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| // The field name is links | |
| Event.observe(window, "load", function() { | |
| CKEDITOR.replace( 'links', {toolbar : [['Source', 'Link', 'Unlink']], width: 400, height: 100}); | |
| }); |
| // Returns true if the parent element contains div.nav_level2 | |
| jQuery.expr[":"].subnav = function(obj){ | |
| return jQuery(obj).parent().find("div.nav_level2").length; | |
| }; | |
| // Using it | |
| $("nav li>a:subnav").click(function(ev){}); | |
| $("nav li>a").not(":subnav").css("background-image", "none"); |
| /* Campfire: https://nonfiction.campfirenow.com */ | |
| body.chat.with_launchbar #Tabs { min-width: 520px !important; } | |
| body.chat.with_launchbar .Left, body.chat.with_launchbar .speak { width: 100% !important; } | |
| body.chat.with_launchbar #input { width: 440px !important; } | |
| body.chat.with_launchbar #Wrapper { padding-left: 0 !important; padding-right: 0 !important; } | |
| body.chat.with_launchbar .Left .col, body.chat.with_launchbar .Full .col { padding: 5px 0 0 !important; background: #fff !important; } | |
| body.chat.with_launchbar #todays_transcript { padding: 5px !important; } | |
| body.chat.with_launchbar #Sidebar { right: 0 !important; } | |
| body.chat.with_launchbar #SidebarTop, body.chat.with_launchbar #search_form, body.chat.with_launchbar #guest_access, body.chat.with_launchbar #files, body.chat.with_launchbar #room_locking { display: none !important; } | |
| body.chat.with_launchbar #participants { background: #ebebeb !important; padding: 5px 2px 2px !important; margin-left: 60px !important; width: 110px !important; opacity: 0.8 ! |
| function pluginsoff(){ | |
| defaults write com.apple.safari WebKitPluginsEnabled -bool false | |
| defaults write com.apple.safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false | |
| defaults write com.apple.safari com.apple.Safari.ReaderPageGroupIdentifier.WebKit2PluginsEnabled -bool false | |
| } | |
| function pluginson(){ | |
| defaults write com.apple.safari WebKitPluginsEnabled -bool true | |
| defaults write com.apple.safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool true | |
| defaults write com.apple.safari com.apple.Safari.ReaderPageGroupIdentifier.WebKit2PluginsEnabled -bool true | |
| } |