Skip to content

Instantly share code, notes, and snippets.

View erikh's full-sized avatar

Erik Hollensbe erikh

View GitHub Profile
<html>
<head>
<title>Welcome to nginx!</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="templater.js"></script>
</head>
<body bgcolor="white" text="black">
<div id="one">Location #1</div>
<div id="two">Location #2</div>
</body>
<dl>
<dt>"Foo":</dt>
<dd><!-- #foo# --></dd>
<dt>"Bar":</dt>
<dd><!-- #bar# --></dd>
</dl>
<dl>
<dt>"Foo":</dt>
<dd><!-- #foo# --></dd>
<dt>"Bar":</dt>
<dd><!-- #bar# --></dd>
</dl>
function process_template(url, id, data) {
$.ajax({
url: url,
data: data,
success: function(msg, ts) { $(id).empty(); $(id).append(msg); }
});
}
function process_json(push_object) {
if (push_object && push_object.url && push_object.data && push_object.id)
require 'rubygems'
require "dbi"
require 'pg'
dbh = DBI.connect("dbi:Pg:gosu_dev", "erikh")
dbh.do("drop table stuff") rescue nil
dbh.do("create table stuff (id serial primary key, my_string varchar(20), my_integer integer, my_time timestamp)")
chars = ('a'..'z').to_a + ('0'..'9').to_a
require 'rubygems'
require "dbi"
require 'pg'
dbh = DBI.connect("dbi:Pg:gosu_dev", "erikh")
dbh.do("drop table stuff") rescue nil
dbh.do("create table stuff (id serial primary key, my_string varchar(20), my_integer integer, my_time timestamp)")
chars = ('a'..'z').to_a + ('0'..'9').to_a
#!/usr/bin/ruby
require 'pp'
log = File.open('access.log', 'r')
begin
lines = []
5.times do
line = log.readline
## The tests in /some/path/test/suite/example.rb [ruby]
BareTest.suite "Map Example Suite" do
suite "Regular Nested Suite" do
assertion "A successful assertion" do
true
end
assertion "A failing assertion" do
failure "Just as an example"
end
require 'socket'
include Socket::Constants
module Swiftcore
module Analogger
# Swift::Analogger::Client is the client library for writing logging
# messages to the Swift Analogger asynchronous logging server.
#
# To use the Analogger client, instantiate an instance of the Client
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;