This file contains hidden or 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
| Dir["**/*.html"].each do |file| | |
| next if file.include?("index.html") || file.start_with?("_") | |
| data = File.read(file) | |
| next if data.include?("permalink:") | |
| permalink = "/" + file.sub(".html", "/") | |
| puts "#{file} => #{permalink}" |
This file contains hidden or 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
| class ProxyTest | |
| attr_accessor :scope | |
| class ScopeProxy | |
| def initialize(obj, scope) | |
| @obj = obj | |
| @scope = scope | |
| end |
This file contains hidden or 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
| TO_TSVECTOR(ARRAY_TO_STRING(holder_names)) || |
This file contains hidden or 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
| SELECT *, | |
| TO_TSVECTOR(holder_names) || | |
| TO_TSVECTOR(first_name) || | |
| TO_TSVECTOR(last_name) || | |
| TO_TSVECTOR(email) || | |
| TO_TSVECTOR(COALESCE(order_token, '')) AS attendee | |
| FROM ( | |
| SELECT | |
| users.id, | |
| users.first_name, |
This file contains hidden or 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
| machine: | |
| node: | |
| version: 0.12.0 | |
| dependencies: | |
| pre: | |
| - export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH | |
| - npm config set spin false | |
| - npm install -g npm@^2 | |
| - npm install -g bower |
This file contains hidden or 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
| (function(root, factory) { | |
| if (typeof define === 'function' && define.amd) { | |
| // AMD | |
| define('progressbar', [], function() { | |
| return factory(); | |
| }); | |
| } else { | |
| // Browser globals | |
| root.ProgressBar = factory(); | |
| } |
This file contains hidden or 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
| module TwilioHelper | |
| module TwilioMocker | |
| def deliveries | |
| @deliveries ||= [] | |
| end | |
| def create(options) | |
| deliveries << options |
This file contains hidden or 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 'uri' | |
| require 'net/http' | |
| class Blog | |
| class Connection | |
| def request(url, &block) | |
| req = Net::HTTP::Get.new(url) | |
| req.basic_auth(ENV['blog_user'], ENV['blog_password']) if ENV['blog_user'] |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require "bigdecimal" | |
| def to_percent(c) | |
| (c / BigDecimal.new("255.0")).round(3).to_f | |
| end | |
| color = ARGV.shift.to_s.strip.sub("#", "") |
This file contains hidden or 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
| module TimeHacks | |
| class << Time | |
| def now | |
| Time.new + offset | |
| end | |
| def offset | |
| @offset ||= 0 |