Skip to content

Instantly share code, notes, and snippets.

require 'bench_press'
extend BenchPress
author 'Ken Collins'
summary 'Iterate over rows of array data.'
reps 10_000
ROWS = [
[1, 'Test', 'Body copy', Time.now],
require 'bench_press'
extend BenchPress
author 'Ken Collins'
summary "Check and populate a options hash"
reps 100_000
measure "Hash#key?" do
o = {}
require 'bench_press'
extend BenchPress
author 'Ken Collins'
summary 'Object class inspection vs duck typing.'
reps 100_000
module Foo
class Bar
require 'bench_press'
require 'odbc'
extend BenchPress
author 'Ken Collins'
summary 'Best way to fetch results from an ODBC statement handle.'
reps 1000
sproutcore-metal
/core.js
defines the SC namespace
/platform.js
defines object creation
defines defineProperty
checks for native setters/getters
/utils.js
@michiel
michiel / cors-nginx.conf
Created July 5, 2011 10:41
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@tvandervossen
tvandervossen / gist:1231476
Created September 21, 2011 07:33
Mobile Safari viewport sizes on iOS 4.3 and 5
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@wycats
wycats / HTMLBars Plan.md
Last active December 18, 2015 15:59
HTMLBars Binding

HTMLBars serves as a polyfill for a native implement of node.bind.

Instead of letting the browser parse the HTML and generate nodes, which leaves us at the mercy of the limitations of the parser, HTMLBars implements an HTML parser and generates the nodes itself.

As HTMLBars generates the nodes, it calls into node.bind if it detects mustache syntax.

Open questions:

  • MDV "syntaxes"
@ebidel
ebidel / Web Components Resources.md
Last active February 27, 2023 22:04
List of resources related to Web Components
var get = Ember.get, set = Ember.set, doc = document;
var FastSelectComponent = Ember.Component.extend({
items: null,
valuePath: 'value',
labelPath: 'label',
value: null,
selected: null,
tagName: 'select',