Skip to content

Instantly share code, notes, and snippets.

View aussiegeek's full-sized avatar
🚲
Thinking about riding

Alan Harper aussiegeek

🚲
Thinking about riding
View GitHub Profile
<?php
function verify_password($password, $crypted_password, $password_salt) {
$digest = $password . $password_salt;
for ($i=0; $i < 20; $i++) {
$digest = hash('sha512', $digest);
}
return $digest == $crypted_password;
}
?>
RewriteCond %{REQUEST_URI} !^/(store|images|scripts|favicon.ico|javascript|SpryAssets|stylesheets|robots.txt).*
RewriteRule (.*) http://www.domain.com$1 [R,L]
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy(
kCFAllocatorDefault,
CFArrayGetCount(people),
people
);
CFRelease(people);
#!/bin/sh
export AWS_ACCESS_KEY_ID="<s3 access id>"
export AWS_SECRET_ACCESS_KEY="<s3 secret access key>"
export PASSPHRASE="" #left blank intentionally
export DEST="s3+http://<backup bucket name>/"
export SRC="<local src path>"
export GPG_KEY="<e-mail address of gpg key>"
duplicity --encrypt-key $GPG_KEY --full-if-older-than 1M $SRC $DEST
duplicity remove-older-than 1Y $DEST --force
duplicity cleanup $DEST --force
$ gh fork
/Users/alan/.rvm/gems/ruby-1.9.2-p0/gems/github-0.4.5/lib/github/extensions.rb:11: warning: undefining `object_id' may cause serious problems
/Users/alan/.rvm/gems/ruby-1.9.2-p0/gems/github-0.4.5/lib/github.rb:151:in `module_eval': /Users/alan/.rvm/gems/ruby-1.9.2-p0/gems/github-0.4.5/lib/commands/commands.rb:57: syntax error, unexpected ')' (SyntaxError)
helper.tracking.sort { |(a,),(b,)| a == helper.origin ? -...
^
/Users/alan/.rvm/gems/ruby-1.9.2-p0/gems/github-0.4.5/lib/commands/commands.rb:57: syntax error, unexpected '|', expecting '='
...per.tracking.sort { |(a,),(b,)| a == helper.origin ? -1 : b ...
... ^
/Users/alan/.rvm/gems/ruby-1.9.2-p0/gems/github-0.4.5/lib/commands/commands.rb:57: syntax error, unexpected '}', expecting keyword_end
...rigin ? 1 : a.to_s <=> b.to_s }.each do |(name,user_or_url)|
@aussiegeek
aussiegeek / tramtracker.rb
Created July 25, 2013 01:19
Job to get tram data for dashing
require "rexml/document"
SCHEDULER.every '1m', :first_in => 0 do |job|
stop_no = 1819
url = URI.parse('http://ws.tramtracker.com.au/pidsservice/pids.asmx')
request =Net::HTTP::Post.new(url.path)
request.body = %Q{<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Header>
<PidsClientHeader xmlns="http://www.yarratrams.com.au/pidsservice/">
# frozen_string_literal: true
# exa & bat are used in my .zshrc aliases, so install it asap
brew 'exa'
brew 'bat'
tap 'homebrew/bundle'
tap 'homebrew/cask'
tap 'homebrew/services'
tap 'homebrew/cask-drivers'