Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Currently available for work. Let me know how I can help you!

Ron Evans deadprogram

💭
Currently available for work. Let me know how I can help you!
View GitHub Profile
ron-evanss-macbook-pro-15:mysql-plugin-test-app ron$ pool -v start
-- PoolParty cloud: MySql Plugin Test App
On ami-4bb05422
Minimum instances: 1
Maximum instances: 4
Polling every: 30.seconds
Keypair: mysql-test
Access key: 0CT2X9HAFADR370JWN02
size: m1.small
Monitors available:
=begin rdoc
PoolParty plugin to install and configure mysql on any instance designated as a database instance.
Written by Ron Evans (http://deadprogrammersociety.com)
Features of the current plugin:
- Installs current Mysql
- Does live database backup to S3 once every hour
- If the instance goes down, will automatically bring up another one, and restore latest backup
$ pool -v -i start
-- PoolParty cloud: MySql Plugin Test App
On ami-4bb05422
Minimum instances: 1
Maximum instances: 4
Polling every: 30.seconds
Keypair: mysql-test
Access key: 0CT2X9HAFADR370JWN02
size: m1.small
Monitors available:
solution :myapp do
cloud :db do
mysql :master => 1, :max_slaves => 4
end
cloud :web do
rails ...
nginx ...
end
pool :poolpartyrb do
plugin_directory "plugins"
cloud :app do
# Configuration
configure { :maximum_instances => 1, :keypair => "name" }
minimum_instances 1
Host exerpoints.unfuddle.com
User git
IdentityFile ~/.ssh/id_rsa
class VitalStatType
attr_accessor :title, :value_type. :possible_values
end
VitalStat::Gender = VitalStatType.new(:title => 'Gender', :value_type => :select, :possible_values => {:male => 'Male', :female => 'Female'})
VitalStat::Age = VitalStatType.new(:title => 'Age', :value_type => :number)
VitalStat::Ethnicity = VitalStatType.new(:title => 'Ethnicity', :value_type => :multiple, :possible_values =>
{ :african_american => 'African American',
:american_indian => 'American Indian',
:asian => 'Asian',
class VitalStatType
attr_accessor :title, :possible_values
def conditions
end
end
class VitalStatSelectType < VitalStatType
def conditions
end
sql << (" AND (list_entries.site = '" + domain + "'")
sql << (" OR list_entries.site = '" + subdomain + "'" )
current_subdir = subdomain.chomp("/")
subdirs.split("/").each do |dir|
current_subdir = current_subdir + "/" + dir
sql << " OR list_entries.site = '" + current_subdir + "'"
end
// Create the web request
HttpWebRequest request
= WebRequest.Create("https://api.del.icio.us/v1/posts/recent") as HttpWebRequest;
// Add authentication to request
request.Credentials = new NetworkCredential("username", "password");
// Get response
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{