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
property iPadName : "The iPad Name" | |
activate application "SystemUIServer" | |
tell application "System Events" | |
tell application process "ControlCenter" | |
set displayMenu to (menu bar item 1 of menu bar 1 whose title contains "Display") | |
click displayMenu | |
delay 0.1 | |
click checkbox iPadName of scroll area 1 of group 1 of window "Control Center" | |
click displayMenu |
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
source 'https://rubygems.org' | |
gem 'activerecord', '4.1.2' | |
gem 'mysql2' |
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
# The $provide service is used to override an injected dependency | |
# Bad - results in Error: [ng:areq] Argument 'fn' is not a function, got Object | |
module 'someModule', ($provide) -> | |
$provide.value "SomeService", SomeMock | |
# Good | |
module 'someModule', ($provide) -> | |
$provide.value "SomeService", SomeMock | |
null |
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 parallel_assignment_test(array, &block) | |
block.call array | |
end | |
animals = ["pig", "cow", "dog"] | |
# One | |
parallel_assignment_test(animals) { |one, two, three| | |
puts "One: #{one}" | |
puts "-------" |
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 update_with_password(params={}) | |
result = nil | |
current_password = params.delete(:current_password) | |
if params[:password].blank? | |
params.delete(:password) | |
params.delete(:password_confirmation) if params[:password_confirmation].blank? | |
result = self.update_without_password(params) | |
else | |
result = if valid_password?(current_password) |