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
#!/usr/bin/env ruby | |
require 'ap' | |
require 'pry' | |
require 'platform-api' | |
token = 'c' # Create token as seen at https://github.com/heroku/platform-api#a-real-world-example | |
heroku = PlatformAPI.connect_oauth(token) | |
apps = heroku.app.list | |
app_names = apps.map { |app| app['name'] unless app['name'].include?('-pr-') }.compact |
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 Alcoholic | |
def abv | |
4.2 | |
end | |
end | |
class Lager | |
include Alcoholic | |
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
# | |
# Finds the longest palindrome in a string | |
# Works for palindromes of both even and odd length | |
# Has O(n^2) runtime, which is not the fastest | |
# Manacher's algorithm promises O(n) time | |
# | |
# Odd length example: "ABCBAHELLOHOWRACECARAREYOUILOVEUEVOLIIAMAIDOINGGOOD" | |
# Result: 'ILOVEUEVOLI' | |
# | |
# Even length example: "forgeeksskeegfor" |
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' | |
# core | |
gem 'rails', '3.2.16' | |
gem 'mysql2', '0.3.10' | |
# models | |
gem 'kaminari', '0.13.0' | |
# views |
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 'active_support' | |
module TestConcern | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def test_class_method | |
puts "I gots class!" | |
end | |
end |