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
public byte[] ReadModelNumber() { | |
var loader = new HidDeviceLoader(); | |
var device = loader.GetDevices(0x1234, 0x9876).First(); | |
HidStream stream; | |
device.TryOpen(out stream); | |
var message = new byte[] { 0, 0xaa }; | |
stream.Write(message); | |
return stream.Read(); | |
} |
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
def self.playlist_id | |
SystemConfiguration.youtube.playlist.id | |
end | |
# or | |
config.api_key = SystemConfiguration.airbrake.api_key | |
# or |
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 'pathname' | |
module TestProductionDataImportToFedora | |
module_function | |
def go(dir) | |
source_dir = find_source dir | |
validate_running_from_rails_root | |
reset_everything |
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 expect | |
spawn $env(FEDORA_HOME)/server/bin/fedora-rebuild.sh | |
expect "Enter (1-3) --> " { send "1\r" } | |
expect "Enter (1-2) --> " { send "1\r" } | |
interact |
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 MakeFirefoxLaunchInBackground | |
module_function | |
def run | |
webdriver_path = `bundle show selenium-webdriver`.chomp | |
launcher_path = "#{webdriver_path}/lib/selenium/webdriver/firefox/launcher.rb" | |
if !File.exist?(launcher_path) | |
raise "Couldn't find the Firefox launcher file at [#{launcher_path}]." | |
end | |
expected_launch_line = '@binary.start_with @profile, @profile_dir, "-foreground"' |
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
scenario 'closing the map and looking at it later', screenshot: true do | |
# ... | |
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
# 8/16/2012 | |
# This is here specifically for font awesome. It causes QT and capybara-webkit | |
# to crash while trying to load the font. | |
# If you are aware of any better way to take care of this problem, let | |
# me know! | |
if Rails.env.test? | |
Rails.application.config.assets.paths.reject! { |path| path.to_s =~ /fonts/ } | |
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
desc 'Continuous integration task' | |
task ci: %w[ ci:prepare file_store:clear db:migrate ] do | |
exec({ 'RAILS_ENV' => nil }, 'rake', 'spec', 'spec:javascripts') | |
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 SessionsController < Devise::SessionsController | |
before_filter only: :new do | |
params.delete(:user) | |
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
class AcademicServicesRouter extends Backbone.Router | |
routes: | |
'records': 'records' | |
'financial_aid': 'financial_aid' | |
'admissions': 'admissions' | |
initialize: ({@view}) => | |
@view.bind 'records_selected', => @navigate('/records', true) | |
@view.bind 'financial_aid_selected', => @navigate('/financial_aid', true) | |
@view.bind 'admissions_selected', => @navigate('/admissions', true) |
NewerOlder