Skip to content

Instantly share code, notes, and snippets.

View Cazz0r's full-sized avatar

Cameron Young Cazz0r

  • Sydney, Australia
View GitHub Profile
@Cazz0r
Cazz0r / pre-commit
Created February 16, 2020 23:26
git pre-commit disallow user from committing
#!/bin/sh
# Retrieve author information as Git sees it while commiting
AUTHORINFO=$(git var GIT_AUTHOR_IDENT) || exit 1
NAME=$(printf '%s\n\n' "${AUTHORINFO}" | sed -n 's/^\(.*\) <.*$/\1/p')
EMAIL=$(printf '%s\n\n' "${AUTHORINFO}" | sed -n 's/^.* <\(.*\)> .*$/\1/p')
# If we're trying to commit to repo with not allowed email
if [[ $EMAIL == *"<REPLACE_ME>"* ]]; then
printf "NAME: %s\n" "${NAME}"
@Cazz0r
Cazz0r / find_state.php
Created October 19, 2015 02:31 — forked from henare/find_state.php
Function to determine Australian state from a postcode, from http://waww.com.au/ramblings/determine-state-from-postcode-in-australia
/**
* Returns the state for a postcode.
* eg. NSW
*
* @author http://waww.com.au/ramblings/determine-state-from-postcode-in-australia
* @link http://en.wikipedia.org/wiki/Postcodes_in_Australia#States_and_territories
*/
function findState($postcode) {
$ranges = array(
'NSW' => array(
<?php
namespace Bitcoin\BTCChina;
class API
{
protected $key;
protected $secret;