Skip to content

Instantly share code, notes, and snippets.

View osiro's full-sized avatar

Vinny Osiro osiro

View GitHub Profile
def greg
[
'Anal assassin (United Kingdom) or anal astronaut[15]',
'Anal Buccaneer',
'Arse bandit[16]',
'Back door bandit[17]',
'Backgammon player (late 18th century Britain)[18]',
'Batty boy (alternatively botty boy),[19] also batty man',
'Bent, bentshot[20] or bender[21] [22]',
'Bone smuggler[23]',
#assign_user
when user already exists but is not linked with trainee
should not create a new user based on the trainee
should associate user with the trainee
should return the user whose trainee was associated with
when user already exists and is already linked with trainee
should not create a new user based on the trainee
should return the user whose trainee was associated with
when user does not exists yet
should create a new user based on the trainee
Medianet::DigitalImage
.image_urls_for
when content type is artists
returns a hash containing urls for artist images
when content type is album
returns a hash containing urls for album images
when content type is videos
returns a hash containing urls for videos images
when content type is tv
returns a hash containing urls for tv images
#available_positions
should include #<Position id: 295, manager_id: 2752, name: "et, et, voluptatem, and eos", created_at: "2013-04-12 01:41:23", updated_at: "2013-04-12 01:41:23", active: true>, #<Position id: 296, manager_id: 2752, name: "et, hic, tenetur, and nostrum", created_at: "2013-04-12 01:41:23", updated_at: "2013-04-12 01:41:23", active: true>, and #<Position id: 297, manager_id: 2752, name: "ea, asperiores, et, and est", created_at: "2013-04-12 01:41:23", updated_at: "2013-04-12 01:41:23", active: false>
should not include #<Position id: 298, manager_id: 2753, name: "magni, ad, qui, and ipsum", created_at: "2013-04-12 01:41:23", updated_at: "2013-04-12 01:41:23", active: false>
should not include #<Position id: 301, manager_id: 2754, name: "atque, tempore, asperiores, and nihil", created_at: "2013-04-12 01:41:24", updated_at: "2013-04-12 01:41:24", active: true>
#required_courses
should include #<Course id: 1000, manager_id: 2756, name: "cupiditate, recusandae, deleniti, and id
1.9.3p392 :015 > @twitter_user = Twitter::Client.new(oauth_token: "27792705-Rck7ctaHJyxWlQbQwWTh7d8iLRbKECyiO5CNT0fvr", oauth_token_secret: "ylnoZZsReNofgcs7VBRFAR6yRya99fyhYuaIac2E")
=> #<Twitter::Client:0x007f8dc4339970 @consumer_key="xgCcAq42YmnuLXC4SvZQcQ", @consumer_secret="8CuIIPcmJ28C4EbrBgR3aoqvK8vc6N7o2k0QVXcmrY", @oauth_token="27792705-Rck7ctaHJyxWlQbQwWTh7d8iLRbKECyiO5CNT0fvr", @oauth_token_secret="ylnoZZsReNofgcs7VBRFAR6yRya99fyhYuaIac2E", @endpoint="https://api.twitter.com", @connection_options={:headers=>{:accept=>"application/json", :user_agent=>"Twitter Ruby Gem 4.6.2"}, :request=>{:open_timeout=>5, :timeout=>10}, :ssl=>{:verify=>false}}, @identity_map=false, @middleware=#<Faraday::Builder:0x007f8dbcaa3970 @handlers=[Twitter::Request::MultipartWithFile, Faraday::Request::Multipart, Faraday::Request::UrlEncoded, Twitter::Response::RaiseError, Twitter::Response::ParseJson, Twitter::Response::RaiseError, Faraday::Adapter::NetHttp]>>
1.9.3p392 :016 >
1.9.3p392 :017 >
1.9.3p392 :018 > @twitter_u
class Api::V1::JukeboxRoomParticipantsController < Api::V1::ApiController
respond_to :json
load_and_authorize_resource :jukebox_room
load_and_authorize_resource through: :jukebox_room
def index
end
def create
@jukebox_room.jukebox_room_participants.create! do |jukebox_room_participant|
@osiro
osiro / jukebox.rb
Last active December 11, 2015 22:39
###### MODEL
class JukeboxRoom < ActiveRecord::Base
#..code here
scope :expired, where{ expires_at <= Time.now }
#..code here
end
###### SPEC
require 'spec_helper'
# Note: I'm using Timecop
jukebox_room.reload.expires_at
Thu, 31 Jan 2013 12:16:39 WST +08:00
24.hours.from_now
Thu, 31 Jan 2013 12:16:39 WST +08:00
jukebox_room.reload.expires_at == 24.hours.from_now
false
@osiro
osiro / venues_index_controller.js.coffee
Created November 29, 2012 07:09
venues_index_controller.js.coffee
class GotApp.VenueIndexController extends tfg.BackPanel
title: I18n.t 'title'
className: 'screen-venues'
day: (new Date).strftime('%A').toLowerCase()
elements:
'.venues-index-venue' : 'listOfVenues'
@osiro
osiro / how_to.rb
Created November 16, 2012 02:10
How to make caipirinha
def name_of_the_drink ingredients
case ingredients
when 'cachaca + lime + ice + sugar'
return 'Caipirinha'
when 'voda + lime + ice + sugar'
return 'Caipiroska'
when 'lime + ice + sugar'
return 'Lemon Juice'
when 'ice + sugar'
return 'Sweet water'