Skip to content

Instantly share code, notes, and snippets.

View whatupdave's full-sized avatar

Dave Newman whatupdave

  • Twitter
  • Seattle, WA
View GitHub Profile
# https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference
grammar JS
rule program
(spacing statement spacing)*
end
rule statement
block / function / if_else / for_in / for / ternary / let / [^;\{\}]+ ';' {
def statements
var a = function(){ };
a.prototype.wrong = 'Dave: mayor of wrongville';
var b = function(){};
b.prototype = new a;
var c = function(){};
c.prototype = new b;
var d = new c;
# Thursday
- 10:15 Writing Large Applications in JavaScript: Douglas Crockford
- 11:15 How to build an iPhone application in 45 minutes: Patrick Linskey
- 13:00 Domain Specific Languages and Language Oriented Programming: Amanda Laucher
- 14:00 Speeding Ducks: Avi Bryant
- 15:15 Fuzz-Testing Rails Apps with Tarantula: Glenn Vanderburg
- 16:15 How to do write tests/stories for RubyGems and Rails plugins: Dr Nic
- 17:15 Atlassian: An Australian Success Story: Mike Cannon-Brookes
%a - The abbreviated weekday name (``Sun'')
%A - The full weekday name (``Sunday'')
%b - The abbreviated month name (``Jan'')
%B - The full month name (``January'')
%c - The preferred local date and time representation
%d - Day of the month (01..31)
%H - Hour of the day, 24-hour clock (00..23)
%I - Hour of the day, 12-hour clock (01..12)
%j - Day of the year (001..366)
%m - Month of the year (01..12)
var migrations = from m in typeof (WebConfigMigrator).GetMethods()
where m.Name.StartsWith("Migration_")
let migrationNumber = int.Parse(Regex.Match(m.Name, @"Migration_(\d+)").Groups[1].Value)
where migrationNumber > currentVersion
orderby migrationNumber
select m;
@whatupdave
whatupdave / Basic jQuery plugin
Created August 23, 2009 05:04
jQuery plugin
(function($) {
$.fn.present = function(options) {
var self = this;
options = $.extend({
// defaults
}, options);
$.extend(this, {
clicked: function(e) {
@whatupdave
whatupdave / AwesomeTestExtensions.cs
Created December 8, 2009 23:08
Assert Awesomely
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
using NUnit.Framework.Constraints;
namespace NUnit.Framework
{
public static class AwesomeTestExtensions
@whatupdave
whatupdave / commands
Created July 19, 2010 06:35
Static site in heroku
git init
git add .
git commit -m "Initial"
heroku create <APP>
heroku addons:add custom_domains
heroku domains:add <APP>.com
heroku domains:add www.<APP>.com
git push heroku master
class ROpenStruct < OpenStruct
def initialize(hash=nil)
@table = {}
for k,v in hash
@table[k.to_sym] = wrap(v)
new_ostruct_member(k)
end
end
def wrap(value)
class Object
def self.instance_methods_by_module
class_methods = []
self.ancestors.reverse.each do |a|
new_methods = a.instance_methods.sort
class_methods.each do |cm|
new_methods = new_methods - cm[1]
end
class_methods << [ a.name, new_methods ]
end