Skip to content

Instantly share code, notes, and snippets.

@bluekeys
bluekeys / SketchSystems.spec
Last active November 15, 2018 10:04
HR Interface
HR Interface
Checking 8pm SSIS package has run
Checking that itrentlive-c-kronos-wim-in doesnt have HR file
Checking HR File Exists
file exists -> Checking HR File Is Less Than 24 hrs old
file missing -> Sending Failure Email
Checking HR File Is Less Than 24 hrs old
file young -> Checking HR Progress File Exists
@bluekeys
bluekeys / SketchSystems.spec
Last active November 13, 2018 11:28
Crime Database Client*
Crime Database Client*
App Start*
connected? -> Connected?
connectionless? -> Connectionless?
App Resume
Connectionless?
Welcome Unconnected*
Local Store Empty
;;;
;;; Recursively list files in a given directory
;;;
;;; Author: daniel m german dmg at uvic dot ca
;;; Copyright: daniel m german
;;; License: Same as Emacs
;;;
(defun directory-files-recursive (directory match maxdepth ignore)
"List files in DIRECTORY and in its sub-directories.
Return files that match the regular expression MATCH but ignore
@bluekeys
bluekeys / gist:8415826
Last active January 3, 2016 05:29
Install anki on funtoo
# Installing anki on funtoo.
This is just a braindump. No promises.
# package.use
dev-python/PyQt4 webkit
# Dependencies
emerge PyQt4 mplayer lame portaudio sqlalchemy
@bluekeys
bluekeys / chroot.txt
Created November 4, 2013 13:06
Into funtoo chroot
swapon /dev/sda3
mkdir /mnt/funtoo
mount /dev/sda4 /mnt/funtoo
mkdir /mnt/funtoo/boot
mount /dev/sda1 /mnt/funtoo/boot
cd /mnt/funtoo
mount -t proc none proc
mount --rbind /sys sys
mount --rbind /dev dev
@bluekeys
bluekeys / Gemfile
Last active December 25, 2015 22:28
Here's an example Gemfile. So I can stop looking it up when I create a project. It includes some of my current favourite gems.
# http://bundler.io/v1.3/man/gemfile.5.html
source 'https://rubygems.org'
ruby '1.9.2'
gem 'rake'
gem 'psych'
gem 'mechanize'
gem 'write_xlsx'
@bluekeys
bluekeys / block_local_variables
Created June 8, 2013 21:31
Trying to access local variables of a block
class Scraper
def scrape!(&block)
instance_eval &block
b = block.binding
eval("p local_variables", b)
end
end
s = Scraper.new
@bluekeys
bluekeys / preferred_timestamp.js
Last active December 10, 2015 11:48
My preferred javascript timestamp - an implementation of an ISO 8601 wannabe
function Timestamp () {
var d, t, year, month, day, hour, minute, second, millisecond;
d = new Date();
t = '';
year = d.getFullYear();
month = ('00' + (Number(d.getMonth()) + 1)).slice(-2);
day = ('00' + d.getDate()).slice(-2);
@bluekeys
bluekeys / gist:887503
Created March 25, 2011 19:46
A contrived JRuby example
require 'java'
list = java.util.ArrayList.new
os = java.lang.System.get_property 'os.name'
home = java.lang.System.get_property 'java.home'
mem = java.lang.Runtime.get_runtime.free_memory
list << os
list << home