Skip to content

Instantly share code, notes, and snippets.

View zosiu's full-sized avatar

Zsófia Balogh zosiu

  • 07:23 (UTC +02:00)
View GitHub Profile
@zosiu
zosiu / human.rb
Created November 2, 2014 05:48
age calculation in ruby
require 'time'
class Human
attr_reader :birth_date
def initialize(birth_date)
@birth_date = birth_date
end
@zosiu
zosiu / 01_how_to_setup_google_auth_with_devise.md
Last active August 29, 2015 14:08
Rails 4 & devise & google oauth2
  • register a new project here
  • set the followings under APIs & auth:
    • Consent screen: fill out the requires fields
    • APIs: Contacts API & Google+ API
    • Creditentials: create a new OAuth client ID
      • AUTHORIZED JAVASCRIPT ORIGINS: HOST (your app host) (protocol prefixed!)
      • AUTHORIZED REDIRECT URI: HOST/auth/google/callback (protocol prefixed!)
  • sign in url is user_omniauth_authorize_path(:google)
@zosiu
zosiu / xdg-open
Created December 5, 2013 21:06
Patched /usr/bin/xdg-open script for Lubuntu to open magnet and sublime links.
#!/bin/sh
#---------------------------------------------
# xdg-open
#
# Utility script to open a URL in the registered default application.
#
# Refer to the usage() function below for usage.
#
# Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
# Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>