Skip to content

Instantly share code, notes, and snippets.

View nstielau's full-sized avatar

Nick Stielau nstielau

  • Red Hat
  • San Francisco
View GitHub Profile
<script type="text/javascript" src="http://0to255.com/d862cb.js?variable=myColors"/>
<script type="text/javascript">
for (i=0; i< myColors.colors.length,i++) {
document.write("<div style='background-color:" + myColors.colors[i] + ";height:20px;'></div>");
}
</script>
#!/usr/bin/ruby
if ARGV.size < 1 || ARGV.size > 2
puts "Usage: #{__FILE__} PATH_TO_PROJECT [CIJOE_URL]"
exit 1
end
##############################
JABBER_USERNAME = "example@gmail.com"
JABBER_PASSWORD = "secret"
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
##################################
# Edit these
set :application, "example_node_app"
set :node_file, "hello_world.js"
set :host, "ec2-174-129-114-66.compute-1.amazonaws.com"
ssh_options[:keys] = [File.join(ENV["HOME"], ".ec2", "default.pem")]
set :repository, "git://gist.github.com/479007.git"
set :branch, "master"
#!/usr/bin/env ruby
require 'rubygems'
require 'stomp'
################################
# Config
stage = "dev"
host = "example.com"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="plugin_functions-Type" plugin_functions="text/html; charset=utf-8">
<title>jQuery noConflict() for third-party-widgets</title>
<!-- Date: 2010-09-12 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/JavaScript"></script>
</head>
@nstielau
nstielau / gist:742862
Created December 16, 2010 00:57
scalr "ec2_get_option_query_env list-virtualhosts" output
root@ec2-174-129-105-XXX:/usr/local/aws/bin# ec2_get_option_query_env list-virtualhosts
<?xml version="1.0"?>
<response><vhosts><vhost hostname="assets3.XXXinc.com" https="0" type="apache"><raw><![CDATA[0]]></raw></vhost></vhosts></response>
@nstielau
nstielau / crontab_entry.sh
Created January 19, 2011 17:43
Simple script for pushing data to Mongolab mongodb REST api via Curl.
Nicks-MacBook-Pro:viewer nstielau$ crontab -l
*/5 * * * * /path/to/send_metric_to_mongolab.sh
module Mongoid
module Processable
extend ActiveSupport::Concern
included do
@action = :process
@timeout = 60
@query = {}
field :processable, :type => Hash, :default => {:processable => {:locked_by => nil, :locked_at => nil, :last_error => nil}}
end
@nstielau
nstielau / set_environment.rb
Created May 9, 2011 00:04
A Knife plugin to set node environment
## Knife plugin to set node environment
# See http://wiki.opscode.com/display/chef/Environments
#
## Install
# Place in .chef/plugins/knife/set_environment.rb
#
## Usage
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env
# Looking for mynode.net
# Setting environment to my_env
@nstielau
nstielau / Bash example
Created May 10, 2011 17:23
A Chef report_handler and knife plugin to persist and query updated actions
Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node log nstielau_vagrantup.com
Time Recipe Action Resource Type Resource
Tue May 10 10:25:20 -0700 2011 nginx::source create template proxy.conf
Tue May 10 10:25:20 -0700 2011 nginx::source enable service nginx
Tue May 10 09:50:42 -0700 2011 nginx::source create template /etc/init.d/nginx