See Dart Milestone 1 Language Changes
To run: dart playing.dart or open playing.html in Dartium (or compile using dart2js and open in other browser)
| span.custom-rally-label { | |
| border-radius: 3px; | |
| display: inline-block; | |
| padding: 2px 4px; | |
| font-weight: bold; | |
| color: white; | |
| text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); | |
| white-space: nowrap; | |
| vertical-align: baseline; | |
| background-color: #0d2d78; |
| #! /usr/bin/env ruby | |
| require 'rack' | |
| require 'thin' | |
| directory = ARGV[0] || Dir.pwd | |
| directory = File.expand_path(directory) | |
| puts "Serving #{directory}" | |
| port = (ARGV[1] || 3000).to_i | |
| puts "http://localhost:#{port}/" |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| textarea { width: 100%; height: 150px; } | |
| </style> | |
| <script> | |
| window.addEventListener('keydown', function(e) { | |
| if ((e.keyCode == 10 || e.keyCode == 13) && event.ctrlKey) | |
| run(); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src='petitest.js'></script> | |
| <link rel='stylesheet' href='petitest.css' /> | |
| </head> | |
| <body> | |
| <h1 id='header'>Hello world!</h1> | |
| <a id='change-link' href='#' onclick='document.getElementById("header").textContent = "Changed!";'>Change Header</a> |
| #! /bin/sh | |
| # | |
| # *MINIMAL* setup script | |
| # | |
| sudo aptitude install vim git nginx | |
| # make nginx serve your home directory | |
| sudo rm -rf /usr/share/nginx/www |
| # Working on lots of different branches of different repos | |
| # has been a pain lately, especially when trying to address | |
| # issues in multiple branches at once. | |
| GOTO_BRANCH_DIR="$HOME/.goto-branch" | |
| GOTO_BRANCH_REPOS="$GOTO_BRANCH_DIR/repos" | |
| GOTO_BRANCH_BRANCHES="$GOTO_BRANCH_DIR/branches" | |
| _goto-branch_usage() { | |
| echo "Usage: goto-branch repo-name [branch-name | master]" |
| source :rubygems | |
| gem 'capybara' | |
| gem 'rspec' |
| apps = { | |
| 'localhost.first' => ->(env) { [200, {'Content-Type' => 'text/plain'}, ['App 1']] }, | |
| 'localhost.second' => ->(env) { [200, {'Content-Type' => 'text/plain'}, ['App 2']] } | |
| } | |
| run ->(env) do | |
| request = Rack::Request.new(env) | |
| if app = apps[request.host] | |
| app.call(env) |
See Dart Milestone 1 Language Changes
To run: dart playing.dart or open playing.html in Dartium (or compile using dart2js and open in other browser)
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
| <script> | |
| function write() { | |
| var $out = $("#output"); | |
| $out.text($out.text() + "\n" + JSON.stringify(arguments)); | |
| } |