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 solution(number) | |
(( (number%3).zero?? 'Fizz' : '') + ((number%5).zero?? 'Buzz' : '')).sub(/^$/, number.to_s) | |
end | |
raise unless solution(7) == "7" | |
raise unless solution(3) == "Fizz" | |
raise unless solution(5) == "Buzz" | |
raise unless solution(15) == "FizzBuzz" | |
puts "It works!" |
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
# Please fill in the method definition below: | |
def Organizer 📚=📚.select{|📕|📕=~/\w{5,}/&&📕!='tomatoes'} | |
# Modify the solution above. Emojis are free. | |
# Code below will check correctness. | |
example_collection = [ | |
'apples', | |
33, | |
nil, | |
'hat', | |
'tomatoes', |
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
require 'pry' | |
# Build a baby names search engine. | |
# | |
# We collected baby names from various published lists and put them into a JSON object as follows: | |
# | |
# key: source list name (e.g. "2015-us-official-boys", "2015-baby-center-girls") | |
# value: a list of names in the order of popularity (e.g. [ "Sophia", "Emma", "Olivia", ... ]) | |
# baby-names-data.json | |
# data is static | |
# as effecint as possible (preproccess data) |
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
require 'rspec' | |
RSpec::Matchers.define :be_path do |expected| | |
match do |actual| | |
path(actual) == path(expected) | |
end | |
failure_message do |actual| | |
"expected that #{path(actual)} would point to #{path(expected)}" | |
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
#!/bin/bash | |
# mv dlog to ~/bin | |
# chmod +x ~/bin/dlog | |
# set default app on line 9 | |
# use: dlog [app] | |
setup(){ | |
# configure variables | |
app=${1:-default-deis-app} | |
log_dump="/tmp/.logs_dump_$app.txt" |
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 BeerSong | |
def song | |
verses(99,0) | |
end | |
def lyrics | |
verses 99, 0 | |
end | |
def verses(starting, ending) |
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
RSpec.describe "Home", type: :request do | |
before :all do | |
get home_path | |
end | |
describe "Index Page" do | |
it "works! (now write some real specs)" do | |
expect(response).to have_http_status(200) | |
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 MrMeeseeks | |
attr_accessor :next, :job | |
def initialize(job = "find job") | |
@job = job | |
end | |
end | |
# A Mr Meeseeks Box is a queue | |
class MrMeeseeksBox | |
attr_accessor :head |
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
# svn directory ^/tags/release/ | |
# 1/ | |
# 2/ | |
# 3/ | |
# 4/ | |
# usage: svnnextrelease fixes email formatting | |
# generated line: svn cp ^/trunk ^/tags/release/# -m'fixes email formatting' | |
function svnnextrelease(){ | |
NextVersion=$(svn ls ^/tags/release | tail -n 1 | while read tag; do expr $(echo "${tag%?}") + 1; done) |
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
/* | |
* AppController.j | |
* TableCibTest | |
* | |
* Created by Francisco Tolmasky on July 5, 2009. | |
* Copyright 2009, 280 North, Inc. All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> |
NewerOlder