Skip to content
View user_test.rb
require 'test_helper'
class UserTest < ActiveSupport::TestCase
setup do
@user_from_linkedin = User.from_omniauth(OmniAuth.config.mock_auth[:linkedin])
@user_from_google = User.from_omniauth(OmniAuth.config.mock_auth[:google])
test "should create new user from omniauth hash" do
View gravatar.rb
#!/usr/bin/env ruby
require 'digest/md5'
require "addressable/uri"
# this is based on gravatar image API
# options :
# size : <integer> size of image
# default: <string> url of image if email not found or:
# * 404
#! /usr/bin/env python2
# Requires: PIL, colormath
# Improved algorithm now automatically crops the image and uses much
# better color matching
from PIL import Image, ImageChops
from colormath.color_objects import RGBColor
import argparse
import math
View rspec.log
I, [2014-01-07T15:09:54.404914 #86163] INFO -- : Not reporting to Code Climate because ENV['CODECLIMATE_REPO_TOKEN'] is not set.
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
should respond to #password_confirmation
should respond to #company_name
should respond to #name
should respond to #password_reset_token
should respond to #email
View nginx.conf
upstream unicorn {
server unix:/tmp/ fail_timeout=0;
server {
listen 80 default deferred;
# server_name;
root /home/deployer/apps/blog/current/public;
location ^~ /assets/ {
# Accept already established connections (so it doesnt drop your current SSH session)
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Accept SSH connections from anywhere
iptables -A INPUT -p tcp -i eth0 --dport ssh -j ACCEPT
# (Optional) Accept HTTP connections from anywhere
iptables -A INPUT -p tcp -i eth0 --dport 80 -j ACCEPT
View colored_logger.rb
require 'logger'
class ColoredLogger < Logger
WHITE = "\e[37m"
CYAN = "\e[36m"
MAGENTA = "\e[35m"
BLUE = "\e[34m"
YELLOW = "\e[33m"
GREEN = "\e[32m"
RED = "\e[31m"
BLACK = "\e[30m"
Something went wrong with that request. Please try again.