This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
SECONDS_IN_DAY = (24*60*60) | |
REPORT_ROOT = File.expand_path("~/Documents/Business/Accounts/iTunes Finance Reports") | |
# I group US and WW on the same invoice as they are both in USD | |
INVOICE_GROUPS = [%w{AU}, %w{CA}, %w{GB}, %w{EU}, %w{US WW}, %w{JP}] | |
one_month_ago = Time.now - (30 * SECONDS_IN_DAY) | |
# My "fetch_finance_reports" script puts reports in a sub-dir e.g. 2010-09-Aug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
God.watch do |w| | |
w.uid = "git" | |
w.gid = "git" | |
w.name = "camo" | |
w.pid_file = "/data/camo/tmp/camo.pid" | |
w.interval = 30.seconds | |
w.env = { | |
"PORT" => '8080', | |
"CAMO_KEY" => '0x24FEEDFACEDEADBEEFCAFE' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SMSTester | |
def initialize | |
@number_of_sms = 0 | |
@number_expected = 0 | |
end | |
def should_have_received_message_containing | |
@number_expected += 1 | |
# do something that might send an SMS | |
@number_of_sms_sent += # introspect this somehow? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SERVER=https://api.no.de | |
SCRIPT="$0" | |
if [ ${SCRIPT:0:1} == "/" ]; then | |
SCRIPT="$(basename -- "$SCRIPT")" | |
fi | |
main () { | |
cmd=${1-help} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'eventmachine' | |
require 'json' | |
require 'mimic' | |
require 'logger' | |
module FakeCampfireServer | |
class Handler | |
def initialize(ipc) | |
@ipc = ipc | |
@ipc.delegate = self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Events" | |
tell current location of network preferences | |
set VPNservice to service "Name of VPN" | |
if exists VPNservice then disconnect VPNservice | |
end tell | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 puts "\e[1m\e[34m ,%%%, \e[0m" | |
26 puts "\e[1m\e[34m ,%%%` %==-- \e[0m" | |
27 puts "\e[1m\e[34m ,%%`( '| \e[0m" | |
28 puts "\e[1m\e[34m ,%%@ /\_/ \e[0m" | |
29 puts "\e[1m\e[34m ,%.-\"\"\"--%%% \"@@__ \e[0m" | |
30 puts "\e[1m\e[34m %%/ |__`\ \e[0m" | |
31 puts "\e[1m\e[34m .%'\ | \ / // \e[0m" | |
32 puts "\e[1m\e[34m ,%' > .'----\ | [/ \e[0m" | |
33 puts "\e[1m\e[34m < <<` || \e[0m" | |
34 puts "\e[1m\e[34m `\\\ || \e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2010 Drew Blas <[email protected]> | |
# From: http://drewblas.com/2010/07/15/an-analysis-of-gpled-code-in-thesis | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'digest/sha1' | |
require 'yaml' | |
puts "Enter passphrase: " | |
passphrase = gets.chomp | |
cipher = OpenSSL::Cipher::Cipher.new("AES-256-CBC") |