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
| | | | +-o IOAudioSelectorControl <class IOAudioSelectorControl, id 0x100000393, !registered, !matched, active, busy 0 (142 ms), retain 22> | |
| | | | | | { | |
| | | | | | "IOAudioControlType" = 1936483188 | |
| | | | | | "IOAudioSelectorControlAvailableSelections" = ({"IOAudioSelectorControlSelectionValue"=1751412846,"IOAudioSelectorControlSelectionDescriptionKey"="Headphones"}) | |
| | | | | | "IOAudioControlChannelNumber" = 0 | |
| | | | | | "IOAudioControlChannelID" = 0 | |
| | | | | | "IOAudioControlValue" = 1751412846 | |
| | | | | | "IOAudioControlUsage" = 1869968496 | |
| | | | | | "IOAudioControlID" = 0 | |
| | | | | | "IOAudioControlSubType" = 1869968496 |
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 fizzy?(string) | |
string.match(/fizz/) | |
end | |
p fizzy?("foobar") # => nil | |
p fizzy?("fizzbuzz") # => #<MatchData "fizz"> |
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
# With tweaks | |
text.scan(/#/).each do |match| | |
line1 | |
line2 | |
foo | |
end | |
describe "Foo" do | |
it "finds customers" do |
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
var users = { | |
"friend" : 1, | |
"foe" : 0 | |
}; | |
$("<style type='text/css'>span.djs-highlight { font-weight: bold; }</style>").appendTo("head"); | |
function traverseFromUserLink(el) { | |
return $(el).closest('td').find('span.comment'); | |
} |
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 daemonize(name = File.basename($0), options = {}) | |
pid_path = options[:pid_path] || File.expand_path("tmp/pids/#{name}.pid") | |
# If the pid file exists, check that the process is actually still running. | |
begin | |
if File.exists?(pid_path) && Process.kill(0, File.read(pid_path).to_i) | |
$stderr.puts "Already running." | |
exit 1 | |
end | |
rescue Errno::ESRCH |
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
class Foo | |
def initialize(bar) | |
@bar = bar | |
end | |
def foobar(prefix) | |
"#{prefix}: imaginary long running process: #{@bar}" | |
end | |
end |
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
module Bar | |
@@bar = "blah blah" | |
end | |
class Foo | |
include Bar | |
def self.bar | |
@@bar | |
end |
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
class FooTwo | |
def bar | |
puts "bar" | |
end | |
def cap_bar | |
def bar | |
puts "BAR!!!" | |
end | |
end |
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
class Foo | |
def bar | |
puts "bar!" | |
end | |
end | |
foo = Foo.new | |
foo.bar # outputs "bar!" | |
class Foo |
NewerOlder