Skip to content

Instantly share code, notes, and snippets.

View mxmzb's full-sized avatar
🍜
Probably eating

Maxim mxmzb

🍜
Probably eating
View GitHub Profile
@mxmzb
mxmzb / bookshelftest.js
Last active August 29, 2015 14:13
Bookshelf fetchAll()
var _ = require("underscore"),
steam = require("steam"),
util = require("util"),
fs = require("fs"),
dota2 = require("dota2"),
bot = new steam.SteamClient(),
Dota2 = new dota2.Dota2Client(bot, true);
var models = require("./models");
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :recoverable, :rememberable, :trackable, #:validatable,
:omniauthable, :omniauth_providers => [:steam]
#:database_authenticatable, :registerable,
def self.from_omniauth(auth)
where(steam_id: auth.uid).first_or_create do |user|
user.steam_id = auth.uid