This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"bids": [ | |
{ | |
"line_item_id": "193781", | |
"amount": "0.1777" | |
}, | |
{ | |
"line_item_id": "193782", | |
"amount": "0.1931" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
widgets: function(){ | |
return this.get('store').peekAll('widget'); | |
}.property(), | |
actions: { | |
addWidget: function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/^\$?\-?([1-9]{1}[0-9]{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\-?\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))$|^\(\$?([1-9]{1}\d{0,2}(\,\d{3})*(\.\d{0,2})?|[1-9]{1}\d{0,}(\.\d{0,2})?|0(\.\d{0,2})?|(\.\d{1,2}))\)$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctype html | |
/[if lt IE 7] | |
html.no-js.lt-ie9.lt-ie8.lt-ie7 lang="en" | |
/[if IE 7] | |
html.no-js.lt-ie9.lt-ie8 lang="en" | |
/[if IE 8] | |
html.no-js.lt-ie9 lang="en" | |
| <!--[if (gte IE 8)]<!--> | |
<html class="no-js"> <!--<![endif]--> | |
head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "benchmark" | |
n = 50000 | |
a = ('A'..'Z').to_a | |
a = a.zip(a) # [["A", "A"], ["B", "B"], ["C", "C"]...] | |
Benchmark.bm(7) do |x| | |
x.report("manual:") { n.times do; a.map {|b| ['X', b[0], b[1]] }; end } | |
x.report("flatten:") { n.times do; a.map {|b| ['X', b].flatten }; end } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def longest(a) | |
a.map(&:length).max | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.recipes/growl.rb | |
# | |
# Notifo setup in deploy scripts: | |
# set :notifo_service "NOTIFO_SERVICE_NAME" # Only if different from :application | |
# set :notifo_service_secret "NOTIFO_API_SECRET" # Only if different from application name | |
# set :notifo_subscriber_list "username1, username2" # Define default below to your username | |
# set :notifo_hostname 'example.com' # Defaults to :server_hostname. Set to empty string to use Notifo default | |
require 'notifo' rescue nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.caprc | |
# Loads all capistrano recipes in ~/.recipes/ folder | |
Dir["#{ENV['HOME']}/.recipes/*.rb"].each do |tasks| | |
load tasks | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var setTextMeasure = function (contentElement, targetMeasure, maxSize, minSize) { | |
if (!contentElement) contentElement = document.createElement('p'); | |
if (!targetMeasure) targetMeasure = 66; | |
if (!maxSize) maxSize = 16; | |
if (!minSize) minSize = 9; | |
var sizer = contentElement.cloneNode(); | |
sizer.style.cssText = 'margin: 0; padding: 0; color: transparent; background-color: transparent; position: absolute;'; |