Skip to content

Instantly share code, notes, and snippets.

View ashfire908's full-sized avatar

Valerie Hampe ashfire908

View GitHub Profile
@ashfire908
ashfire908 / keybase.md
Created July 13, 2018 17:01
Keybase proof

Keybase proof

I hereby claim:

  • I am ashfire908 on github.
  • I am ashfire908 (https://keybase.io/ashfire908) on keybase.
  • I have a public key ASCh9RpCjCiQJUBYUFoE1CWIqyNGT81JOglewiSUMmD3FAo

To claim this, I am signing this object:

#!/bin/sh
# SSH agent loader
# Config
KEYS_FILE="$HOME/.ssh/agent_keys"
AUTH_SOCK="$HOME/.ssh/agent_auth_sock"
# Find the PID for the SSH agent
find_agent () {
if [ "$TERM" = "cygwin" ]; then
@ashfire908
ashfire908 / gametime.php
Created October 14, 2010 05:59
Functions for woking with the total_gametime format in the Halo: Reach API
<?php
function playtime_to_seconds($total_playtime) {
// Regex for parsing the playtime format
$regex = '/(?<neg>\-?)P((?P<days>\d*)D)?(T((?P<hours>\d*)H)?((?P<minutes>\d*)M)?((?P<seconds>\d*(\.\d{0,7})?)S)?)?/';
// Run regex
preg_match($regex, $total_playtime, $matches);
// Calculate seconds from playtime format
$playtime = 0;
<?php
$game_id = 135212637;
$player_id = 7;
$use_file = false;
$key = '<your key here>';
$url = 'http://www.bungie.net/api/reach/reachapijson.svc/game/details/' . $key . '/' . rawurlencode($game_id);
// Set up cURL