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 | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz | |
tar -xvzf ruby-2.0.0-p0.tar.gz | |
cd ruby-2.0.0-p0/ | |
./configure --prefix=/usr/local | |
make | |
make 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
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz | |
tar -xvzf ruby-1.9.3-p327.tar.gz | |
cd ruby-1.9.3-p327/ | |
./configure --prefix=/usr/local | |
make | |
make 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
-- replace table_name with the name of your database table, e.g. users | |
-- replace data with the serialized field in the table, e.g. nicknames | |
-- output generates serialized data that decrypts to a Ruby array. | |
-- data with quotes, hyphens, or spaces will have issues with this query. | |
-- preview the YAML to JSON to confirm the conversion is working. | |
SELECT data, REPLACE(REPLACE(REPLACE(REPLACE(REGEXP_REPLACE(REPLACE(REPLACE(REPLACE(data, | |
' ', ''), | |
'...', ''), | |
'---', '["'), |
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
# rbenv inspired by https://gist.github.com/1441139 | |
# make sure running as root user | |
apt-get -y update | |
apt-get install linux-headers-2.6.32-5-amd64 | |
apt-get -y upgrade | |
apt-get -y install curl git-core python-software-properties build-essential git-core curl libssl-dev libreadline5 libreadline5-dev zlib1g zlib1g-dev libcurl4-openssl-dev libxslt-dev libxml2-dev | |
# add-apt-repository | |
curl -o /usr/sbin/add-apt-repository http://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txtchmod o+x /usr/sbin/add-apt-repository |
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
apt-get update | |
apt-get upgrade | |
apt-get -y install curl git-core python-software-properties | |
# nginx | |
add-apt-repository ppa:nginx/stable | |
apt-get -y update | |
apt-get -y install nginx | |
service nginx start |
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 'awesome_print' | |
require 'nori' | |
Nori.parser = :nokogiri | |
xml = <<EOS | |
<?xml version="1.0" encoding="UTF-8"?> | |
<categories> | |
<category id="1234"> | |
<styleId>123</styleId> |