Skip to content

Instantly share code, notes, and snippets.

View ys's full-sized avatar
💭
Doing stuff with computers

Yannick Schutz ys

💭
Doing stuff with computers
View GitHub Profile
ls . | xargs -I file vim -d file /comparable_folder/file
class SuggestedUsers
attr_reader :user, :options
def initialize(user, options = nil)
@user = user
@options = options || {}
end
def suggested_users
User.joins('JOIN follows as follows_follows ON follows_follows.followee_id = users.id')
class SuggestedUsers
attr_reader :user
def initialize(user)
@user = user
end
def suggested_users
User.joins('JOIN follows as follows_follows ON follows_follows.followee_id = users.id')
.joins('JOIN follows as user_follows ON follows_follows.follower_id = user_follows.followee_id')
set nocompatible
" ========================================================================
" Vundle stuff
" ========================================================================
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Let Vundle manage Vundle (required)!
" Begin .vimrc
"
set nocompatible
"
" ================
" Ruby stuff
" ================
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
" Begin .vimrc
"
set nocompatible
"
" ================
" Ruby stuff
" ================
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif
" Begin .vimrc
"
set nocompatible
"
" ================
" Ruby stuff
" ================
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
a = Tempfile.new('e')
=> #<File:/var/folders/xq/42ckp5s51v7gtnwdmnn4r_5m0000gn/T/e20130716-67827-148wsqy>
a == a
=> true
a === a
=> false
expected: #<File:/tmp/coucou20130716-1190-14ky45y-0>
got: #<File:/tmp/coucou20130716-1190-14ky45y-0> (using ==)
class Track
def_delegator ActiveSupport::Notifications, :instrument
def self.post_creation(post, user)
instrument 'post.creation' , { user_id: user.id, post_id: post.id }
end
end