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
<div id="into_the_lab"> | |
<div class="arrow"></div> | |
<p><%= link_to "Go into the lab", "http://ec2-50-17-36-93.compute-1.amazonaws.com", :target => "_blank" %></p> | |
</div> | |
<script> | |
// Make the whole div clickable | |
$("#into_the_lab").click(function(){ | |
window.location=$(this).find("a").attr("href"); | |
return false; |
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 | |
# Daniel Verner | |
# CarrotPlant LLC | |
# 2011 | |
# Backup each mysql databases into a different file, rather than one big file | |
# Optionally files can be gzipped (dbname.gz) | |
# | |
# Usage: dump_all_databases [ -u username -o output_dir -z ] | |
# | |
# -u username to connect mysql server |
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 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "mysql", | |
:host => "localhost", | |
:username => "root", | |
:password => "", | |
:database => "super" | |
) |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Spotty plots</title> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script src="https://raw.github.com/shutterstock/rickshaw/master/vendor/d3.min.js"></script> | |
<script src="https://raw.github.com/shutterstock/rickshaw/master/rickshaw.min.js"></script> | |
<link type="text/css" rel="stylesheet" href="https://raw.github.com/shutterstock/rickshaw/master/rickshaw.min.css"> | |
</script> |
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
traps = Dir.glob('*') | |
count = 0 | |
traps.each do |trap| | |
if File.directory? trap | |
Dir.chdir(trap) | |
rolls = Dir.glob('*') | |
rolls.each do |roll| | |
if File.directory? roll |
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 'aws-sdk' | |
require 'pry' | |
require 'mongoid' | |
Mongoid.configure do |config| | |
config.sessions = { | |
:default => { | |
:hosts => ["somewhere.mongohq.com:27083"], :database => "development", :username => "username", :password => "password" } | |
} | |
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
// Request using instance API names defined here: http://aws.amazon.com/ec2/instance-types/ | |
// curl http://spot.arfon.org/instances/m1.large | |
// Example response below | |
[{ | |
"availability_zone": "us-east-1d", | |
"current_price": 0.066, | |
"id": "50b196d2a2fc8eef10000048", | |
"name": "m1.large", | |
"pricing_history": { |
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
// Request using availability zone codes | |
// curl http://spot.arfon.org/availability_zones/us-east-1b | |
// Example response below | |
[{ | |
"availability_zone": "us-east-1b", | |
"current_price": 0.0635, | |
"id": "50c070e7884b630002000005", | |
"name": "m3.xlarge", | |
"pricing_history": { |
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
// Request using availability zone codes and instance type codes | |
// curl http://spot.arfon.org/instances/m1.large/us-east-1b | |
// Example response below | |
[{ | |
"availability_zone": "us-east-1b", | |
"current_price": 0.026, | |
"id": "50b196d8a2fc8eef100000c0", | |
"name": "m1.large", | |
"pricing_history": { |
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
// Request using availability zone codes | |
// curl http://spot.arfon.org/cheapest/m1.large | |
// Example response below | |
{ | |
"linux": { | |
"availability_zone": "us-east-1a", | |
"current_price": 0.026, | |
"id": "50b196d2a2fc8eef1000004d", | |
"name": "m1.large", |