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 'spec_helper' | |
describe "Issue with default_scope and eager loading" do | |
class Post | |
include Mongoid::Document | |
belongs_to :blog | |
end | |
class Blog | |
include Mongoid::Document |
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 'backports' | |
class Hello | |
def failed_with_backports | |
private_methods.grep(/(.+)_copy$/) { raise StandardError if $1 == nil } | |
end | |
end | |
Hello.new.failed_with_backports |
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 'spec_helper' | |
describe "Issue 1973" do | |
class Match | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
belongs_to :user1, :class_name => "User", :inverse_of => 'hosted_matches' belongs_to :user2, :class_name => "User", :inverse_of => 'invited_matches' | |
end |
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 'faraday' | |
require 'faraday_middleware' | |
url_project = 'https://ciblonet.basecamphq.com' | |
project_id = 3684800 | |
user_name = 'shingara' | |
password = 'xxxx' | |
class Attachment |
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
Hi, | |
I am shingara on twitter. And I have a little chat with you on | |
twitter. I have always issue on Plizy with youtube video. | |
After some investigation, I see my problem arrive in most of the time | |
on in my home where I have free as provider ( in France ). I know | |
there are some issue on Free and youtube peering. But I can see | |
youtube video on my Device ( Galaxy Tab 10.1 GT-P7510 ). I test on | |
Orange provider and some video are not available. But not at all. |
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 'benchmark' | |
array = [] | |
1_000.times do | |
x = [] | |
100.times do | |
x << [1,10] | |
end | |
array << x | |
end |
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
def mix_periods | |
list_period = seasons.inject([]) do |acc, season| | |
season.periods.each do |period| | |
acc << (period.start_date..period.end_date) | |
end | |
acc | |
end | |
while !list_period.empty? | |
period_test = list_period.pop |
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
source "https://rubygems.org" | |
gem 'mechanize' |
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
set nocompatible " be iMproved | |
filetype off " required! | |
set rtp+=~/vimbundle/bundle/vundle/ | |
call vundle#rc() | |
Bundle 'tpope/vim-fugitive' | |
Bundle 'tpope/vim-git' | |
Bundle 'tpope/vim-haml' | |
Bundle 'pangloss/vim-javascript' |
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
def self.dragonfly(config_file) | |
require 'oahu_models/image_magick_processor' | |
config_file = Pathname.new(config_file) | |
app = Dragonfly[:oahu] | |
app.configure_with(:imagemagick) | |
app.define_macro_on_include(Mongoid::Document, :image_accessor) | |
app.processor.register(Oahu::Models::ImageMagickProcessor) |