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
| # AppleScript to reset safari. | |
| # Originally found at http://macscripter.net/viewtopic.php?id=30178&action=new | |
| tell application "Safari" to set ResetSafari_loc to localized string "Reset Safari…" | |
| if ResetSafari_loc ends with "…" then | |
| set ResetSafari_loc to text 1 thru -2 of ResetSafari_loc | |
| else if ResetSafari_loc ends with "..." then | |
| set ResetSafari_loc to text 1 thru -4 of ResetSafari_loc | |
| end if |
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
| # Example SConstruct File for a CppUTest project | |
| import os.path | |
| from os import getcwd | |
| # Construct variables for the SUT and test binaries | |
| # This is based on the base directory name that SConstruct lives in | |
| component_name = os.path.basename(getcwd()) | |
| component_tests_name = component_name + "_tests" | |
| # Construct the list of source files for the SUT |
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
| # Example SConstruct File for a Igloo-test project | |
| import os.path | |
| from os import getcwd | |
| # Construct variables for the SUT and test binaries | |
| # This is based on the base directory name that SConstruct lives in | |
| component_name = os.path.basename(getcwd()) | |
| component_tests_name = component_name + "_tests" | |
| # Construct the list of source files for the SUT |
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
| ls _posts/* | grep -c -E '[0-9]{4}-[0-9]{2}-[0-9]{2}' | while read fn; do day=`grep '#postdate\|#date' $fn | cut -d '-' -f 3 | cut -d ' ' -f 1`; git mv $fn `echo $fn | sed -E "s/-\([0-9]{2}\)-/-\1-$day-/"`; done |
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 'rake' | |
| require 'rake/testtask' | |
| task :default => [:test_units] | |
| desc "Run basic tests" | |
| Rake::TestTask.new("test_units") do |test| | |
| test.pattern = 'test/*_test.rb' | |
| test.verbose = true | |
| test.warning = true |
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 "Fun REST API Function" do | |
| before(:each) do | |
| @api = FunRestApi.new | |
| end | |
| context "when creating a valid widget" do | |
| it "responds with a success message" do |
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
| desc "Run both API v2 and v3 specs" | |
| task :api => [:apiv2, :apiv3] | |
| desc "Run only API v2 specs" | |
| RSpec::Core::RakeTask.new(:apiv2) do |task| | |
| task.pattern = 'spec/v2/*_spec.rb' | |
| task.rspec_opts = "--format progress --fail-fast" | |
| end | |
| desc "Run only API v3 + Webhooks specs" |
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 RadioChannels | |
| def self.get_data(url) | |
| # Some code | |
| end | |
| def mixed_in_method(url) | |
| RadioChannels.get_data(url) | |
| end | |
| 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
| require 'rubygems' | |
| require 'sinatra' | |
| Sinatra::Base.show_exceptions = false | |
| class App < Sinatra::Base | |
| helpers do | |
| def my_helper_method |
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 Account | |
| attr_writer :logger, :username, :password | |
| def logger logger | |
| @logger ||= logger | |
| end | |
| def login | |
| # do authentication stuff... | |
| begin |
OlderNewer