Skip to content

Instantly share code, notes, and snippets.

View fletcherm's full-sized avatar

Matt Fletcher fletcherm

View GitHub Profile
def append(object)
object << "hello"
end
a = [ 1 ] # array
b = "yo ho ho" # string
c = StringIO.new("yo ho ho") # string IO; still responds to the << method
d = { "hi" => "there" } # hash; does not respond to << method
append a # works
foreach the_place (origin crc_staging ao_staging); git push $the_place master; end
<education>
<year>1999</year>
<school>Hudsonville High School</school>
</education>
public void extractEducationDetails(SoapObject education, IEducationDetails details) {
details.setYear(education.getProperty("year").toString());
details.setSchool(education.getProperty("school").toString());
}
public void extractEducationDetails(SoapObject education, IEducationDetails details) {
details.setYear(education.safeGetProperty("year").toString());
details.setSchool(education.safeGetProperty("school").toString());
}
public void extractEducationDetails(SoapObject education, IEducationDetails details) {
details.setYear(education.safeGetProperty("year", "").toString());
details.setSchool(education.safeGetProperty("school", "").toString());
}
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line"
>
<stroke
android:color="@color/list_divider"
android:width="1dp"
/>
<size
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line"
>
<stroke
android:color="@color/list_divider"
android:width="1dp"
android:dashGap="0dp"
android:dashWidth="1dp"
RSpec.configure do |config|
# RSpec automatically cleans stuff out of backtraces;
# sometimes this is annoying when trying to debug something e.g. a gem
config.backtrace_clean_patterns = [
/\/lib\d*\/ruby\//,
/bin\//,
#/gems/,
/spec\/spec_helper\.rb/,
/lib\/rspec\/(core|expectations|matchers|mocks)/
]
RSpec.configure do |config|
# RSpec automatically cleans stuff out of backtraces;
# sometimes this is annoying when trying to debug something e.g. a gem
config.backtrace_clean_patterns = [
/\/lib\d*\/ruby\//,
/bin\//,
/gems/,
/spec\/spec_helper\.rb/,
/lib\/rspec\/(core|expectations|matchers|mocks)/
]