Skip to content

Instantly share code, notes, and snippets.

View jacques's full-sized avatar
🎯
Focusing

Jacques Marneweck jacques

🎯
Focusing
View GitHub Profile
@lukeredpath
lukeredpath / process_last_months_finance_reports.rb
Created November 15, 2010 13:28
Loop through each finance report and run it using my process_finance_report script, creating an invoice in FreeAgent.
#!/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
@atmos
atmos / lojack-proxy.god.rb
Created November 13, 2010 03:05
god configs for camo.
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'
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?
@kusor
kusor / no.de.sh
Created October 9, 2010 06:43 — forked from isaacs/no.de.sh
no.de API command line client
#!/bin/bash
SERVER=https://api.no.de
SCRIPT="$0"
if [ ${SCRIPT:0:1} == "/" ]; then
SCRIPT="$(basename -- "$SCRIPT")"
fi
main () {
cmd=${1-help}
require 'eventmachine'
require 'json'
require 'mimic'
require 'logger'
module FakeCampfireServer
class Handler
def initialize(ipc)
@ipc = ipc
@ipc.delegate = self
@isaacs
isaacs / authorized_keys
Created August 25, 2010 10:13
Mah pubkeys. Autharahz demz.
ssh-dss AAAAB3NzaC1kc3MAAACBAJ6M0r6x1VWmMZL4/QUfIpFX8hJb0z4yyxgkWI1TDYnFNd3lgI4l5zGZQgnyeaL14BoBbiEoIfAAlQ9dzAYYiX7M5STvR543eLY08Ft15T7vmufmE2aAKQhCyb8Q1bHk3rUHeE4l+DzRXirs53s53MbrG/iiYFOb3yieYrbUkRMlAAAAFQDnjodne9N5V4kC/9PLOdS7hSwUxwAAAIAK5iA45rDaMeEfBwpV7W8DyBvVqy7SBe4av8n547YnVM/n762r3vRl/KlCqpyrgH13aH5YktDrWpKAmlqo7vVCLF2zfTMWkXUKiYuojc/jEcJpi1ayOE0Sa5eH3dQJ17Ilc2prLVGS95/6bEl4ZQv+PLujaibcQ+YArkRPsL7xkwAAAIAZ/AbmFPNMamPYjBh6UV1glBnTBdUhNH0SmWFgBgngyWFQq6Y/SVFa1MHLHWFapixNE5g9c6IcdXS1W+N2Xmb7AnJum8oseMjs6VxAH5AQQHllTE15JspeotaBZsgKWFXH5s/gNEC9mOqqtbM0BA+tqVKXN24lVGEEmHqqfcFBsg== isaacs@sistertrain-lm
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA8MAx3/U3aHXuhpuGhge5xMlqLACKgrFHL+F83YU0rP59bzVKk2mkEY7oXw68knzmasiowUBUBA5h0rt2okUp7YP07iaRyx0nnSIt+h8ADXVPLRHURRxEqz1oPD7dis4brUr1Y/v8+sBP4G8BS0f7b/CGqNaAUpOxprBSx7BLgc7m0uC7iYyAVURjuYNDc2c1D7xsh6rXdvEVkdt6gFTBoZh16dxxoZkunBE/pu0ghk0ygyISyWYGr4vU5BII2H9n0Si5vNbNnOvLZeSYaeO9aeDe/bTK8gPQxAHuFzEZhodWThGYfpqFmBUzC1O7klMGnJpkaR3bBFJ/vT78Xi9zJw== isaacs@sistertrain-lm
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
anonymous
anonymous / gist:508218
Created August 4, 2010 14:29
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"
# 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
@kusor
kusor / decrypt.rb
Created June 11, 2010 10:58
Ruby OpenSSL Cipher
require 'openssl'
require 'digest/sha1'
require 'yaml'
puts "Enter passphrase: "
passphrase = gets.chomp
cipher = OpenSSL::Cipher::Cipher.new("AES-256-CBC")