Skip to content

Instantly share code, notes, and snippets.

View mbadolato's full-sized avatar
🤘

Mark Badolato mbadolato

🤘
  • Cybernox Technologies
  • Phoenix
View GitHub Profile
@mbadolato
mbadolato / unicorn.rb
Created February 23, 2013 23:05 — forked from defunkt/gist:206253
Example unicorn.rb file for Github's configuration
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@mbadolato
mbadolato / 1-Explanations.md
Last active December 17, 2015 11:49 — forked from danvbe/1-Explanations.md
Integrating HWIOAuthBundle and FOSUserBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@mbadolato
mbadolato / Mac version
Last active December 19, 2015 00:39 — forked from lyrixx/post-checkout
#!/bin/bash
# Put this file at: .git/hooks/post-checkout and make it executable
# You can install it system wide too, see http://stackoverflow.com/a/2293578/685587
PREV_COMMIT=$1
POST_COMMIT=$2
NOCOLOR='\x1B[0m'
REDCOLOR='\x1B[37;41m'