- Write a function called
pallindrome?
that returnstrue
orfalse
. The function should take one string parameter (word). Returntrue
if word is equal to itself backwards. For example:palindrome?("the")
should returnfalse
.palindrome?("racecar")
should return true. - Write a function called
anagrams?
that returnstrue
orfalse
. The function should take two string parameters (word1, word2). Returntrue
if word1 and word2 are anagrams of one another. An anagram of a word is another word that has the same letters in a different order. For example:anagrams?('god', 'dog')
should return true.anagrams?('aabb', 'ab')
should return false.
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_relative '../directory/where/those/modules/live' | |
World(InvestorGroups::MemberApplicationHelper) |
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 UpdateDealAggregateRatings < ActiveRecord::Migration | |
def up | |
execute(" | |
update deals set aggregate_rating = ( | |
select avg(deal_rating_avg.by_user) avg_rating | |
from ( | |
select avg(deal_ratings.rating) by_user, dr.user_id | |
from deal_ratings | |
join deal_reviews dr | |
on dr.id = deal_ratings.deal_review_id |
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
/* A font by Jos Buivenga (exljbris) -> www.exljbris.com */ | |
@font-face { | |
font-family: 'MuseoSans'; | |
src: url("/assets/typefaces/museosans_100-webfont.eot"); | |
src: url("/assets/typefaces/museosans_100-webfont.eot?#iefix") format("embedded-opentype"), url("/assets/typefaces/museosans_100-webfont.ttf") format("truetype"), url("/assets/typefaces/museosans_100-webfont.svg#MuseoSans100") format("svg"); | |
font-weight: 100; | |
font-style: normal; | |
} | |
@font-face { |
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
<a href="javascript%3Aapp.layout.togglePanel(Panel.MY_WORK)%3B%0A">My Work</a> |
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
:tddium: | |
:tests: | |
- :type: custom | |
:command: bundle exec rake jasmine:ci | |
:invocation: single | |
:output: exit-status |
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 'rspec' | |
require 'rspec/mocks/standalone' | |
class Foo | |
end | |
Foo.should_receive(:import) | |
Foo.import |
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
find(".select2-input").set(friend.name) | |
wait_for_dom # wait for ajax search to return | |
find(".select2-result-label").click | |
page.should have_content(friend.name) | |
def wait_for_dom | |
uuid = SecureRandom.uuid | |
page.evaluate_script <<-EOS |
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
astoria:gust (master) ng bm$ irb --simple-prompt | |
>> require 'delegate' | |
=> true | |
>> class Foo < DelegateClass(Object) | |
>> end | |
=> nil | |
>> f = Foo.new(Object.new) | |
>> array1 = [[f]] | |
=> [[#<Object:0x007fc92ab72168>]] |