Skip to content

Instantly share code, notes, and snippets.

View denzuko's full-sized avatar
💬
linkedin.com/in/denzuko

Dwight Spencer denzuko

💬
linkedin.com/in/denzuko
View GitHub Profile
@denzuko
denzuko / bot.rb
Created January 15, 2012 12:59 — forked from jpr5/bot.rb
XMPP/Ruby Bot for HipChat
#!/usr/bin/env ruby
#
# Script: HipChat bot in Ruby
# Author: Jordan Ritter <jpr5@darkridge.com>
#
unless `rvm-prompt i g`.chomp == "ree@xmpp"
exec("rvm ree@xmpp ruby #{$0}")
end
@denzuko
denzuko / deploy.rb
Created January 23, 2012 09:51
With thanks to Jason Noble's post at http://pivotallabs.com/blabs/categories/capistrano. I created this updated version that pushes to alerts to my android device. I have a Jabber version in the works and with a little hacking iPhone support should work
require 'httparty'
require 'ruby-notify-my-android'
set :application, "example"
set :repository, ""
set :scm, :none
role :web, "localhost"
role :web, "example.tld"
@denzuko
denzuko / app.js
Created April 11, 2012 05:58 — forked from nrstott/app.js
Bogart CouchDB Blog code translated to use MongoDB
var bogart = require('bogart');
var Q = require('promised-io/lib/promise');
var mongoose = require('mongoose');
var PostSchema = new mongoose.Schema({
title: String,
body: String,
comments: [ CommentSchema ]
});
@denzuko
denzuko / gist:2381206
Created April 14, 2012 00:44 — forked from shripadk/gist:652819
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'
@denzuko
denzuko / wol.py
Created April 17, 2012 19:17
Wake "Everything" on Lan script
#!/usr/bin/env python
# wol.py
# based on http://code.activestate.com/recipes/358449-wake-on-lan/
# added for loop to use arpwatch's MAC address list instead of manually having to maintain a list of MAC addresses
# there could be potential security problems with using the arpwatch list so use at your own risk.
# [DZ]: Original Version by Jeremy Z (10Bitworks SA, Tx) <zunkworks@gmail.com>
# [DZ](Change Log): Added Command Line Option Parsing, regex parsing to wake_on_lan()
@denzuko
denzuko / dropbox_installer.sh
Created April 18, 2012 17:20
Dropbox CLI Installer - Installs Dropbox cloud file sync service onto a full CLI based linux
#!/bin/sh
# Dropbox CLI Installer
# Version 1.0b - Dwight Spencer <dspencer@odesk.com>
# Copyright (C)2009 CompuTEK Industries, LLC. All Rights Reserved.
#
# Installs Dropbox cloud file sync service onto a full CLI based linux
# $ installer=./dropbox_installer.sh; chmod +x $installer && ./$installer
#
function grab()
@denzuko
denzuko / page_inject.coffee
Created May 8, 2012 01:30 — forked from ntreadway/page_inject.coffee
Simple page inject for JQuery Mobile and Rails Partials
# Used to dynamically add a rails page view when using Jquery Mobile
# Author Nick Treadway @nicktea
window.insert_page = (id, content) ->
page = $("<article id="+id+" data-role='page' data-url="+id+" data-add-back-btn='true'>" + content + "</article>")
page.appendTo('body')
$('a').attr("href", "#" + id).click ->
$.mobile.changePage(page, {transition: "slide"})
@denzuko
denzuko / ar_user.h
Created May 30, 2012 18:57
CodeTests 0x01
/**
* ar_user.h
* CodeTests 0x01
*
* Copyright (C)2012, Dwight Spencer (Denzuko) <dspencer@denzuko.co.cc>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
@denzuko
denzuko / mocha.opt
Created May 31, 2012 22:06
HelloJS mocha files
--require should
--reporter spec
--ui bdd
(function() {
describe('Application', function() {
it('should exists', function() {
var app = new Application();
app.should.be.an.instanceof(Application);
});
});
}).call(this);