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
sudo apt-get update && sudo apt-get 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
ruby doctor.rb | |
/usr/bin/ruby1.8 (1.8.6) | |
OpenSSL 0.9.8g 19 Oct 2007: /usr/lib/ssl | |
SSL_CERT_DIR="" | |
SSL_CERT_FILE="" | |
HEAD https://status.github.com:443 | |
OpenSSL::SSL::SSLError: certificate verify failed | |
The server presented a certificate that could not be verified: |
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
ruby doctor.rb facebook.com | |
ruby doctor.rb google.com |
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
# 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 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
# 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 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
// 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 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
#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 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
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 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 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 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 | |
# 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 |