Skip to content

Instantly share code, notes, and snippets.

View brettbuddin's full-sized avatar
🤖
Arguing with computers.

Brett Buddin brettbuddin

🤖
Arguing with computers.
View GitHub Profile
go
› go install github.com/brettbuddin/victor/examples/bot
go
› bot -adapter campfire -name virbot
2012/06/09 19:45:23 Starting up...
2012/06/09 19:45:24 Fetched room info.
2012/06/09 19:45:24 Remembering: Brett Buddin
2012/06/09 19:45:24 Joined room.
2012/06/09 19:45:24 Listening...
2012/06/09 19:45:33 Listener /^(virbot[:,]?)\s*(?:(image|img) (.*))/ triggered by 'virbot img what'
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
var lectric_slider = new Lectric();
lectric_slider.init("#featured_images", {
next:".lectric_right_arrow",
previous:".lectric_left_arrow",
tossing: true,
tossFunction: function(x, dx, dt) {
return x + dx * 100 / dt;
},
hooks: {
init: function(s) {
@brettbuddin
brettbuddin / gist:1544619
Created December 31, 2011 17:19
Grabs the current file's directory
DIRECTORY=$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
var button = function(opts) {
var options = $.extend({ className: 'button', text: 'Change Me' }, opts);
return $('', options);
};
button({text: 'New Widget', href: '/new'}).appendTo('body');
$('', {
id: 'refresh-button',
href: 'http://google.com',
click: function(e) {
e.preventDefault(); alert('Sup?');
},
mouseover: function() {
$(this).addClass('active');
},
mouseout: function() {
$('', { id: 'refresh-button' });
$('sidebar a').click(function(event) {
event.stopPropegation();
});
$('sidebar').click(function() {
alert('A child was clicked!'); // This won't fire if an anchor is clicked.
});
$('a').click(function(event) { event.preventDefault(); alert('Murkturgler!'); });
$('a.button').click(function() {
alert('Hello world!');
return false; // This prohibits the link's default behavior.
});