Skip to content

Instantly share code, notes, and snippets.

Avatar
🕶️

Nathan L Smith smith

🕶️
View GitHub Profile
View rc.jaxer.ubuntu
#! /bin/sh
#
# jaxer This file is used as an init script for Jaxer. It should saved as
# /etc/init.d/jaxer
#
# To enable, run:
# sudo chmod +x jaxer
# sudo update-rc.d jaxer defaults
# from /etc/init.d
#
View jaxer-linux-vhost.template.httpd.conf
# This is a VirtualHost configuration for running Aptana Jaxer 1.0 with an
# existing installation of Apache 2.2 on Ubuntu 8.04 Server (or others.)
#
# Replace the #{...} content with the settings for your site.
# Uncomment this line if this is your only virtual host
# NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@#{example.com}
View blog-in-a-browser.html
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Blog In A Browser</title>
<style>
body { font-family: Helvetica, Arial, sans-serif; margin: 0em; }
h1, h2, h3 { font-weight: normal; padding-left: 1em; }
textarea, a { display: block; }
#tabs { float: left; width: 100%; list-style: none; border-bottom: 1px solid; clear: both; }
View vimrc
" Nathan L Smith's .vimrc file. Based on
" John Lam's .vimrc file
" Use ruby syntax for capfiles
au BufNewFile,BufRead capfile setf ruby
syntax on
set nocompatible
set autoread
filetype on
@smith
smith / jsonschema.js
Created Jun 19, 2009
JSONSchema Validator
View jsonschema.js
/**
* JSONSchema Validator - Validates JavaScript objects using JSON Schemas
* (http://www.json.com/json-schema-proposal/)
*
* Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
* Licensed under the MIT (MIT-LICENSE.txt) licence.
To use the validator call JSONSchema.validate with an instance object and an optional schema object.
If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
that schema will be used to validate and the schema parameter is not necessary (if both exist,
both validations will occur).
View jaxer-narwhal-test-driver.html
<!doctype html>
<html><head>
<script runat="server" src="narwhal/packages/narwhal-jaxer/bootstrap.js"></script>
<script runat="server">
require.paths.push("/opt/narwhal"); // to find "tests"
// for output
system.print = function (s) { document.write(s + "<br />\n"); };
system.stdout.write = system.print;
var t = require("tests/all-tests"),
View Capistrano runing chunks of shell commands.rb
# Helper to execute blocks of shell commands via capistrano run
def run_chunk(cmd,options={})
run cmd.split("\n").map {|l| l.strip }.join(" "), options
end
# Example
task :revision, :roles => [:app] do
run_chunk %Q{
rm -f #{current_release}/public/REVISION;cp #{current_release}/REVISION #{current_release}/public/REVISION;
cd #{current_release}; git config --list | grep branch\.deploy >> #{current_release}/public/REVISION;
View jaxer-mozilla-components-interfaces-list.html
<script runat="server">
var cc = Components.classes,
ci = Components.interfaces;
function w(o) {
for (var i in o) { document.write(i + "<br />"); }
}
document.write("-- Components.classes -- <br />");
w(cc);
View tabs diff for livepipe-ui issue 15.diff
diff --git a/src/tabs.js b/src/tabs.js
index 7efbe24..133c1b8 100644
--- a/src/tabs.js
+++ b/src/tabs.js
@@ -83,10 +83,8 @@ Control.Tabs = Class.create({
throw "Control.Tabs: #" + link.key + " was not found on the page."; }
this.containers.set(link.key,container);
link[this.options.hover ? 'onmouseover' : 'onclick'] = function(link){
- if(window.event) {
- Event.stop(window.event); }
View tabs diff for livepipe-ui issue 17.diff
diff --git a/src/tabs.js b/src/tabs.js
index 7efbe24..fbbb5c9 100644
--- a/src/tabs.js
+++ b/src/tabs.js
@@ -44,6 +44,8 @@ Control.Tabs = Class.create({
return (/^#/).exec((Prototype.Browser.WebKit ? decodeURIComponent(link.href) : link.href).replace(window.location.href.split('#')[0],''));
}).each(function(link){
this.addTab(link);
+ link.writeAttribute("href",null);
+ link.setStyle({cursor:'pointer'});