Skip to content

Instantly share code, notes, and snippets.

@ag4ve
ag4ve / custom-dnode-session.js
Created March 2, 2012 00:46 — forked from tanepiper/custom-dnode-session.js
DNode/Express Mongoose Authentication
// DNode Session
// =============
var connect = require('connect')
module.exports = function(opt) {
var key = opt.key || 'connect.sid'
, store = opt.store
, interval = opt.interval || 120000
@ag4ve
ag4ve / app.js
Created March 2, 2012 05:05
Simple blog with node.js, express and mongodb
var express = require('express'),
app = express.createServer(),
Post = require('./models/post');
app.configure(function () {
app.use(express.methodOverride());
app.use(express.bodyDecoder());
app.use(express.staticProvider(__dirname + '/public'));
app.use(express.compiler({src: __dirname + '/public', enable: ['sass']}));
app.use(express.logger());
@ag4ve
ag4ve / custom-dnode-session.js
Created March 5, 2012 00:44 — forked from tanepiper/custom-dnode-session.js
DNode/Express Mongoose Authentication
// DNode Session
// =============
var connect = require('connect')
module.exports = function(opt) {
var key = opt.key || 'connect.sid'
, store = opt.store
, interval = opt.interval || 120000
@ag4ve
ag4ve / test.pl
Created June 6, 2012 20:57 — forked from chansen/test.pl
US § 6103. HOLIDAYS (Federal)
#!/usr/bin/perl
use strict;
use warnings;
do 'us_federal_holidays.pl';
# Test cases extracted from <http://www.opm.gov/Operating_Status_Schedules/fedhol/Index.asp>
my @tests = (
[ 1997, '1997-01-01', '1997-01-20', '1997-02-17', '1997-05-26', '1997-07-04',
'1997-09-01', '1997-10-13', '1997-11-11', '1997-11-27', '1997-12-25' ],
@ag4ve
ag4ve / xl-cmp.pl
Created July 23, 2012 20:19
erroring: (in cleanup) Can't call method "get_xf_index" on unblessed reference at /usr/local/share/perl/5.10.1/Excel/Writer/XLSX/Worksheet.pm line 5599.
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use Getopt::Long;
use Pod::Usage;
@ag4ve
ag4ve / PKGBUILDs
Created August 24, 2012 17:40
raspberry pi /proc/config.gz et al
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.1.10-13 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_HAVE_SCHED_CLOCK=y
CONFIG_GENERIC_GPIO=y
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
CONFIG_GENERIC_CLOCKEVENTS=y
@ag4ve
ag4ve / build-noxzm.sh
Created August 25, 2012 21:32
byzantium build
#!/bin/sh
# SEARCH AG4VE for notes for you
# Byzantium Linux top level build script.
# by: Sitwon
# This shell script, when executed inside of a Porteus build machine, will
# result in the generation of the file 000-byzantium.xzm.
# Bail on errors
@ag4ve
ag4ve / Controller-Search.pm
Created September 5, 2012 19:45 — forked from anonymous/Controller-Search.pm
KinoSearch Example
package MyApp::Web::Controller::Search;
use 5.010;
use Moose;
use namespace::autoclean;
BEGIN { extends 'Catalyst::Controller'; }
sub index : Path : Args(0) {
my ( $self, $c ) = @_;
@ag4ve
ag4ve / app.js
Created September 9, 2012 00:48
flatiron.js
var path = require('path'),
flatiron = require('flatiron'),
director = require('director'),
ecstatic = require('ecstatic'),
app = flatiron.app,
plugins = flatiron.plugins;
var routes = require('./lib/routes.js');
app.config.file({ file: path.join(__dirname, 'config', 'config.json') });
@ag4ve
ag4ve / app.js
Created September 11, 2012 12:15
flatiron app
var path = require('path'),
flatiron = require('flatiron'),
director = require('director'),
ecstatic = require('ecstatic'),
connect = require('connect'),
app = flatiron.app,
plugins = flatiron.plugins;
var routes = require('./lib/routes.js'),
models = require('./lib/models.js');