Skip to content

Instantly share code, notes, and snippets.

View cfcosta's full-sized avatar

Cainã Costa cfcosta

  • São Paulo, Brazil
View GitHub Profile
@cfcosta
cfcosta / gist:4462975
Last active December 10, 2015 16:48 — forked from anonymous/gist:4462969
class User < ActiveRecord::Base
def self.create_from_omniauth_data(data)
user = new
user.external_provider = true
user.name = data['info']['email']
user.email = data['info']['email']
user.authorizations.build(:provider => omniauth['provider'], :uid => omniauth['uid'])
user.save!
end
#!/usr/bin/env ruby
#
# Brute-force way to retrieve all Github's repositories at once
# Usage:
# github_repos.rb clone # will clone all the user's repositories
# github_repos.rb clone test # will just clone 6 repositories for testing purposes
# github_repos.rb pull # will update all of the user's local repositories
#
# If you have forked repositories, the original sources will be added
# as remotes with the default 'forked_from' name, and a new 'forked_from'