Skip to content

Instantly share code, notes, and snippets.

View avalade's full-sized avatar

Aaron D. Valade avalade

View GitHub Profile
Verifying that +avalade is my blockchain ID. https://onename.com/avalade
@avalade
avalade / xero.el
Created October 8, 2014 07:57
Convert HSBC CSV files to Xero Format
(defun convert-hsbc-to-xero ()
(interactive)
(let ((filename (buffer-file-name))
(new-name (replace-regexp-in-string "\.csv$" "-XERO.csv" (buffer-file-name)))
(hsbc-header-start-regexp "^Date")
(invalid-rows-regexps '("^$" "Opening Balance" "Closing Balance"))
(header-row "*Date,*Amount,Payee,Description,Reference,Check Number\n")
(record-regexp "^\\([0-9/]+\\),\\([[:alpha:][:blank:][:digit:]-/]+\\),\\([0-9.]*\\),\\([0-9.]*\\),\\([0-9.]*\\).*$"))
(copy-file filename new-name)
(find-file new-name)
### Keybase proof
I hereby claim:
* I am avalade on github.
* I am adv (https://keybase.io/adv) on keybase.
* I have a public key whose fingerprint is 434D 714D EA67 7CB2 F548 5B69 BAFD 0832 1ADA 14F4
To claim this, I am signing this object:
/*
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.
@avalade
avalade / git-cache-meta.sh
Created May 25, 2012 00:38 — forked from andris9/git-cache-meta.sh
git-cache-meta
#!/bin/sh -e
#git-cache-meta -- simple file meta data caching and applying.
#Simpler than etckeeper, metastore, setgitperms, etc.
#from http://www.kerneltrap.org/mailarchive/git/2009/1/9/4654694
#modified by n1k
#for Mac OS X, install findutils using Homebrew
# - save all files metadata not only from other users
# - save numeric uid and gid
@avalade
avalade / CQRS_ES_Actor.scala
Created July 5, 2011 03:47 — forked from viktorklang/CQRS_ES_Actor.scala
CQRS and EventSourcing using Akka Actors
import scala.collection.mutable.ListBuffer
import akka.actor.{Actor,ActorRef}
import akka.actor.Actor._
import akka.routing.{ Listeners, Listen }
//Represents a domain event
trait Event
//A builder to create domain entities
trait EntityBuilder[Entity] {
@avalade
avalade / gist:907439
Created April 7, 2011 09:52
ctag_cron_launchagent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ctag_gen</string>
<key>Program</key>
<string>/usr/local/bin/etags-gen</string>
<key>StartCalendar</key>
<integer>600</integer> <!-- Fire every 10 minutes -->
#!/bin/bash
## Generate ctags files for my projects
/usr/local/bin/ctags -h ".scala" -R -e --exclude='*.js' -f ~/.tags/medsense ~adv/Documents/Software/medsense
/usr/local/bin/ctags -h ".java" -R -e --exclude='*.js' -f ~/.tags/snif-bss ~adv/Documents/Software/snif-bss
/usr/local/bin/ctags -h ".scala" -R -e --exclude='*.js' -f ~/.tags/liftweb ~adv/Documents/Software/liftweb
/usr/local/bin/ctags -h ".scala" -R -e --exclude='*.js' -f ~/.tags/dispatch ~adv/Documents/Software/sandbox/Databinder-Dispatch
/usr/local/bin/ctags -h ".scala" -R -e --exclude='*.js' -f ~/.tags/akka ~adv/Documents/Software/sandbox/akka
import bootstrap.liftweb.Application._
import org.apache.activemq.ActiveMQConnectionFactory
import org.apache.activemq.command.ActiveMQTopic
import com.gs.tag.TagDatas.{State}
import com.gs.base_station.Payloads.TagPing
import javax.jms.{BytesMessage, MessageProducer, Session, Destination}
val conn = ctx.getBean("jmsFactory").asInstanceOf[ActiveMQConnectionFactory].createConnection
conn.start
@avalade
avalade / gist:863463
Created March 10, 2011 02:32
Knife ec2 create
#!/bin/bash
knife ec2 server create "role[base]" -i ami-2492ec76 -G default -x ubuntu -f c1.medium --region ap-southeast-1 -Z ap-southeast-1a -S <amazon_key_pair>