This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# http://smirnov-am.blogspot.com/2015/04/installation-of-python-279-in-ubuntu.html | |
# http://davebehnke.com/python-pyenv-ubuntu.html | |
# https://renoirboulanger.com/blog/2015/04/upgrade-python-2-7-9-ubuntu-14-04-lts-making-deb-package/ | |
# install dependencies | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install build-essential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) | |
end | |
test "should create new user from omniauth hash" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'digest/md5' | |
require "addressable/uri" | |
# this is based on gravatar image API | |
# https://en.gravatar.com/site/implement/images/ | |
# options : | |
# size : <integer> size of image | |
# default: <string> url of image if email not found or: | |
# * 404 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rspec | |
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. | |
User | |
should respond to #password_confirmation | |
should respond to #company_name | |
should respond to #name | |
should respond to #password_reset_token | |
should respond to #email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream unicorn { | |
server unix:/tmp/unicorn.blog.sock fail_timeout=0; | |
} | |
server { | |
listen 80 default deferred; | |
# server_name example.com; | |
root /home/deployer/apps/blog/current/public; | |
location ^~ /assets/ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |