This file contains hidden or 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 | |
if grep 'Ubuntu\|Debian' /etc/issue; then | |
echo "Debian based distro detected; installing RVM" | |
sudo apt-get install -y libqt4-gui libqt4-dev cmake libssl-dev libgdbm-dev libncurses5-dev automake libtool bison libffi-dev | |
curl -L https://get.rvm.io | bash -s stable --autolibs=enabled --ruby | |
source ~/.rvm/scripts/rvm | |
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc | |
elif grep 'Fedora' /etc/issue; then | |
echo "Fedora detected, not installing RVM" | |
sudo yum install -y gcc-c++ qt-devel cmake ruby-devel rubygems qtwebkit-devel qtwebkit |
This file contains hidden or 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 | |
# echo "65536 * 3 + 256 * 2 + 25" | bc | |
if [[ -n "${BASH_VERSION:-}" ]] && | |
(( 65536 * ${BASH_VERSINFO[0]} + 256 * ${BASH_VERSINFO[1]} + ${BASH_VERSINFO[2]} < 197145 )) | |
then | |
echo "BASH 3.2.25 required (you have $BASH_VERSION)" | |
exit 1 | |
fi |
This file contains hidden or 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 | |
wget http://git.deluge-torrent.org/deluge/snapshot/deluge-1.3.2.tar.gz | |
tar -zxvf deluge-1.3.2.tar.gz | |
virtualenv ~/deluge | |
source ~/deluge/bin/activate | |
cd ~/deluge-1.3.2 | |
sed -ibackup s/-dev// setup.cfg | |
python setup.py clean -a | |
python setup.py build | |
python setup.py install |
This file contains hidden or 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
@mixin rounded-corner($radius: 5px) | |
-moz-border-radius: $radius | |
-webkit-border-radius: $radius | |
border-radius: $radius | |
@mixin rounded-top-left-corner($radius: 5px) | |
-moz-border-radius-topleft: $radius | |
-webkit-border-top-left-radius: $radius | |
border-top-left-radius: $radius |
This file contains hidden or 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
class Media | |
belongs_to :mediable, :polymorphic => true | |
end | |
class Project | |
has_many :media, :as => :mediable | |
end | |
class Post | |
has_many :media, :as => :mediable |
This file contains hidden or 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 | |
# | |
# usage: script/server_restarter | |
# | |
# Rails autoloading, while nice in theory, frequently doesn't work. Since Rails 2.3+ | |
# is so fast when completely reloading the server, I wrote this script to listen to the | |
# given directories, and kill/restart the server when any file is changed. | |
# | |
# It's quick, simple, and it reliably reloads your application when changes are made. | |
# |
This file contains hidden or 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
class SimpleMailer | |
require 'net/smtp' | |
attr_accessor :email_from, :email_to | |
def initialize(email_from, email_to) | |
@email_from, @email_to = email_from, email_to | |
end | |
def happy_mail | |
message = <<MSG |
This file contains hidden or 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 | |
# Unattended REE/Passenger installation | |
# Source: http://weblog.brightlight-ict.nl/2008/12/unattended-passenger-ruby-enterprise-installation-on-ubuntu-8/ | |
# 15/03/09 Updated to use latest r.e.e. and passenger 2.1 and rewrote bits thanks to the comments left on my blog. Thanks guys | |
if [ "$(whoami)" != "root" ]; then | |
echo "You need to be root to run this!" | |
exit 2 | |
fi | |
NewerOlder