Skip to content

Instantly share code, notes, and snippets.

Dan Webb danwrong

Block or report user

Report or block danwrong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@danwrong
danwrong / flight data
Created Jul 31, 2013
Just a really rough sketch of what I'd like to see as a data binding layer for flight. The idea is that its all just components and events but the model like behavior, the data binding and the rendering are all just added via mixins....
View flight data
// Model
var Todo = defineComponent(asModel, function() {
// this would just be a normal component with extra methods
// that define bindable attributes and other logic
this.properties({
text: String,
complete: Boolean
});
View flight-groups.js
// Flight Proposal: Groups
// Its useful to be able to structure components together
// so that we can manage their lifecycles. We currently
// group components together using simple initialization
// functions which give us a rough structure but don't
// allow us to manage lifecycles easily which has given
// rise to nested components. However, it's not desirable
// to couple one component to another in this way and
// departs from the self contained nature of Flight
View gist:2898919
# Usage:
def streaming
chunked_response do |resp|
resp.chunk do
"before" * 5000
end
resp.chunk do
sleep(1)
View gist:2884729
Time To First Tweet
-------------------
When users come to Twitter.com, the first thing they want to do is read their timeline. The time that it takes for a user to do this formed the backbone of our performance improvements that are currently being rolled out. We'll explain how we measure Time To First Tweet, how we re-engineered our front end to make this as fast as possible and what our next steps will be to improve our user's experience. Through this we can demonstrate that a pragmatic approach to web performance can help you make the biggest positive impact on your users experience.
View gist:2399405
module Mustache
class << self
import com.github.mustachejava.DefaultMustacheFactory
import com.github.mustachejava.jruby.JRubyObjectHandler
def template_dir
Rails.root.join('app', 'templates')
end
def factory
@danwrong
danwrong / gist:1300389
Created Oct 20, 2011
Playlist from Github Millionth User Party 10-17-11
View gist:1300389
Lighter Champion
Pulse vs Flex Lil Silva
Underground Boddika
Soul What Boddika
Bax MOSCA
Kerpow XXXY
Night Hunter FIS T
Reminder - Original Mix Bok Bok
Energise HOSTAGE
Sicko Cell Joy Orbison
View gist:1114468
function delegate(rules) {
return function(e) {
var target = $(e.target), parent = null;
for (var selector in rules) {
if (target.is(selector) || ((parent = target.parents(selector)) && parent.length > 0)) {
return rules[selector].apply(this, [parent || target].concat($.makeArray(arguments)));
}
parent = null;
}
};
View gist:918610
function Template(path) {}
Template.prototype = new loadrunner.Dependency;
Template.prototype.start = function() {
// called when first callback is added
// start the template load
this.load(function(source) {
// call complete when its done
var template = this.compile(source)
this.complete(template);
})
View gist:910802
ree-1.8.7-2009.10 > b = Selenium::Client::Driver.new :host => '192.168.83.131', :port => 4444, :browser => '*firefox c:\Program Files\Mozilla Firefox 3.6\firefox.exe', :url => 'http://172.16.145.39:8888', :timeout_in_seconds => 60
=> #<Selenium::Client::Driver:0x10169bfc0 @default_javascript_framework=:prototype, @port=4444, @default_timeout_in_seconds=60, @browser_url="http://172.16.145.39:8888", @session_id=nil, @extension_js="", @highlight_located_element_by_default=false, @host="192.168.83.131", @browser_string="*firefox c:\\Program Files\\Mozilla Firefox 3.6\\firefox.exe">
ree-1.8.7-2009.10 > b.start_new_browser_session => nil
ree-1.8.7-2009.10 > b.open '/test/test.html' => nil
ree-1.8.7-2009.10 > b.get_eval "window._qunitResults"
=> "[object Object]"
ree-1.8.7-2009.10 > b.get_eval "window._qunitResults.passed"
=> "19"
You can’t perform that action at this time.