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
<VirtualHost *:80> | |
ServerName www.vid.so | |
DocumentRoot /home/admin/vidso/current/public | |
<Directory /home/admin/vidso/current/public> | |
AllowOverride all | |
Options -MultiViews | |
</Directory> | |
</VirtualHost> | |
<Location /> |
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
LoadModule passenger_module /home/admin/.rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.7/ext/apache2/mod_passenger.so | |
PassengerRoot /home/admin/.rvm/gems/ree-1.8.7-2011.03/gems/passenger-3.0.7 | |
PassengerRuby /home/admin/.rvm/wrappers/ree-1.8.7-2011.03/ruby | |
# enable xsendfile | |
XSendFile On | |
# enable sending files from parent dirs | |
XSendFileAllowAbove On |
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 | |
# ffmpegin | |
# this sctipt downloads and install ffmpeg and x264 from SVN and git for the initial install | |
# taken from the excellet tutorial found here: | |
#http://ubuntuforums.org/showthread.php?t=786095&highlight=ffmpeg+x264+latest | |
# all props to fakeoutdoorsman, not me | |
# check http://code.google.com/p/x264-ffmpeg-up-to-date/ for updates | |
###################################### | |
# ver 1.4 by rupert plumridge |
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
class Calculator::PriceBucket < Calculator | |
preference :minimal_amount, :decimal, :default => 0 | |
preference :normal_amount, :decimal, :default => 0 | |
preference :discount_amount, :decimal, :default => 0 | |
def self.description | |
I18n.t("price_bucket") | |
end | |
def self.register |
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 'open-uri' | |
require 'nokogiri' | |
require 'video_info' | |
def extract_youtube_links(link) | |
top_docs = Nokogiri::XML(open(link)) | |
links = URI.extract(top_docs.xpath('//item/description').to_a.join(" ")) | |
links.select { |l| l.include?("watch?v=") } | |
end |
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
#curl -L https://gist.github.com/karlentwistle/5029263/raw/84faa6a15a9c521533e33135090c1214c457f08d/chef_solo_bootstrap.sh | bash | |
aptitude -y update | |
echo "Installing RVM and Ruby dependencies" | |
sudo apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion git-core libgdbm-dev pkg-config libffi-dev | |
echo "Installing RVM system-wide" | |
bash -c "bash <( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide ) --version '1.3.0'" | |
cat >> /etc/profile <<'EOF' | |
# Load RVM if it is installed, | |
# first try to load user install |
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
// http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMechanicalTurkRequester/MakingRequests_RequestAuthenticationArticle.html | |
// 1 The sender constructs a request to AWS. | |
// 2 The sender calculates a Keyed-Hashing for Message Authentication code (HMAC), the request signature using the his or her Secret Access Key and the values of the Service, Operation, and Timestamp parameters as input. | |
// 3 The sender of the request sends the request data, the signature, and Access Key ID (the key-identifier of the Secret Access Key used) to AWS. | |
// 4 AWS uses the Access Key ID to look up the Secret Access Key. | |
// 5 AWS generates a signature from the request data and the Secret Access Key using the same algorithm used to calculate the signature in the request. | |
// 6 If the signature generated by AWS matches the one sent in the request, the request is considered to be authentic. If the comparison fails, the request is discarded, and AWS returns an error response. | |
package main |
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
# config/routes.rb | |
resources :documents do | |
resources :versions, controller: "documents/versions" do | |
post :restore, on: :member | |
end | |
resource :lock, controller: "documents/locks" | |
end | |
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
# Usage: ruby doctor.rb [HOST=status.github.com[:PORT=443]] | |
require 'rbconfig' | |
require 'net/https' | |
if ARGV[0] =~ /^[^-]/ | |
host, port = ARGV[0].split(':', 2) | |
else | |
host = 'status.github.com' | |
end | |
port ||= 443 |
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
ruby doctor.rb facebook.com | |
ruby doctor.rb google.com |
OlderNewer