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 'nokogiri' | |
| require 'net/http' | |
| class ShakespeareAnalyzer | |
| def initialize(url) | |
| @url = url | |
| end | |
| def analyze | |
| speech_elements.inject({}) do |result, element| |
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
| import Control.Applicative | |
| import Data.List.Utils | |
| import Data.Maybe | |
| import Network.HTTP | |
| import Network.HTTP.Headers | |
| import System.IO | |
| import Text.Regex.PCRE | |
| main = do | |
| line <- getLine |
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 | |
| # | |
| # This file was generated by Bundler. | |
| # | |
| # The application 'guard' is installed as part of a gem, and | |
| # this file is here to facilitate running it. | |
| # | |
| require 'pathname' | |
| ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", |
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
| " Lives inside a project directory | |
| setl path+=lib/events | |
| setl path+=lib/advertiser | |
| setl path+=lib/model_view |
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 ArrayMatching | |
| class ArrayMatching | |
| def initialize(array) | |
| @array = array | |
| end | |
| def ==(other_array) | |
| Set.new(@array) == Set.new(other_array) | |
| 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
| class InspectorGadget < BasicObject | |
| def initialize(target, notifier) | |
| @target = target | |
| @notifier = notifier | |
| end | |
| def method_missing(name, *args, &block) | |
| result = @target.public_send(name, *args, &block) | |
| @notifier.invocation(name, args, block, result) | |
| result |
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
| # Filters | |
| # Action name is duplicated in filter blacklist or whitelist | |
| class PoniesController < ApplicationController | |
| before_filter :find_pony, except: [:index] | |
| before_filter :authorize_rider, only: [:edit, :update, :destroy] | |
| def show | |
| end | |
| def index |
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 'spec_helper' | |
| describe 'products/_prime_purchase.html.erb' do | |
| it "tries to sell the user on Prime" do | |
| view.stubs(currently_viewing_subscription_product?: false) | |
| view.stubs(current_user_has_active_subscription?: false) | |
| view.stubs(subscription_product: stub('subscription_product', name: 'foo')) | |
| render template: 'products/_prime_purchase' |
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
| /** | |
| * Version: 1.0 Alpha-1 | |
| * Build Date: 13-Nov-2007 | |
| * Copyright (c) 2006-2007, Coolite Inc. (http://www.coolite.com/). All rights reserved. | |
| * License: Licensed under The MIT License. See license.txt and http://www.datejs.com/license/. | |
| * Website: http://www.datejs.com/ or http://www.coolite.com/datejs/ | |
| */ | |
| Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy", |
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 'rubygems' | |
| require 'json' | |
| require 'net/https' | |
| require 'fileutils' | |
| def usage | |
| puts "usage: copr project_name id" | |
| puts "example: copr capybara-webkit 316" |