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 'rubygems' | |
require 'rmeetup2' | |
RMeetup2::Base.authentication_method = :api_key | |
RMeetup2::Base.api_key = '5c4a7449656e481b691f4a113174d' | |
RMeetup2::Base.get(:events, group_id: '1555691').data['results'].count |
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
<style> | |
table { | |
-webkit-transform:rotate(90deg); | |
margin-top: 200px; | |
} | |
table tr td { | |
height: 20px; | |
white-space: nowrap; |
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 Video < ActiveRecord::Base | |
after_save :background_process_attachment | |
def background_process_attachment | |
video = self.class.find(id) | |
return if video.nil? | |
to_process = [] | |
to_fetch = [] |
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
Testing |
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 Feeds | |
module Cache | |
extend ActiveSupport::Concern | |
module InstanceMethods | |
def redis_client | |
uri = URI.parse(ENV["REDISTOGO_URL"] || "http://localhost:6379/") | |
@redis ||= Redis.new(host: uri.host, port: uri.port, password: uri.password) | |
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 RPG | |
class Battle | |
ARENAS = [:town, :desert, :jungle, :mountain, :boat] | |
attr_accessor :fighters | |
attr_reader :battleground | |
def initialize(fighter_a, fighter_b) | |
@fighters = [fighter_a, fighter_b] |
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 Hero | |
attr_reader :hp | |
def initialize | |
@hp = 100 | |
end | |
def hit!(force) | |
@hp -= force | |
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 Hero | |
attr_reader :hp | |
def initialize | |
@hp = 100 | |
end | |
def hit!(force) | |
@hp -= force | |
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 Hero | |
attr_reader :hp | |
def initialize | |
@hp = 100 | |
end | |
def hit!(force) | |
@hp -= force | |
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
require "rubygems" | |
require "sequel" | |
DB = Sequel.connect("sqlite://urls.db") | |
class Url < Sequel::Model | |
plugin :schema | |
set_schema do | |
primary_key(:id) |