Skip to content

Instantly share code, notes, and snippets.

View averyaube's full-sized avatar

Avery Aube averyaube

View GitHub Profile
Verifying my Blockstack ID is secured with the address 1QJTWeVcQRvvZcWL5fmTtgnERbJ5Bynatf https://explorer.blockstack.org/address/1QJTWeVcQRvvZcWL5fmTtgnERbJ5Bynatf

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@averyaube
averyaube / likes.py
Created July 12, 2012 18:55
Growl Notifier for Facebook Likes
import gntp.notifier
import requests
import json
import time
likes = 0
HARTH_URL = "http://graph.facebook.com/harthrecords"
if __name__ == '__main__':
@averyaube
averyaube / svn.php
Created June 24, 2011 14:56
Tiny PHP svn script
<?php
/**
* Some cool thing that does various little SVN tasks.
* Requires the PECL svn package to be installed!
*
* @author Lowgain / BNOTIONS
*/
// Define some cool parameters here
define('USERNAME', '');
@averyaube
averyaube / null.php
Created June 22, 2011 16:46
Null Kohana Cache
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Just stores nothing, gets nothing. Useful for development
*
* @author Lowgain
*/
class Cache_Null extends Cache {
public function get($id, $default = NULL)
{
@averyaube
averyaube / gist:1030810
Created June 17, 2011 03:23
Bonafide Mechanism for basic Magento passwords
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Basically just an MD5 hash with 1 iteration, and then the salt attached at the end.
*
* @author Lowgain
*/
class Bonafide_Mechanism_Magento extends Bonafide_Mechanism {
public function check($password, $hash, $salt = NULL, $iterations = NULL)
{
@averyaube
averyaube / auth.php
Created May 26, 2011 18:32
Example of twitter authentication in Kohana using Tijs Verkoyen's Twitter SDK
<?php
class Controller_Auth extends Controller {
public function action_twitter()
{
$twitter = new Twitter(CONSUMER_TOKEN, CONSUMER_SECRET);
// Retrieve Request Token
$twitter->oAuthRequestToken(CALLBACK_URL); // In this case, should go back to auth/twitter
@averyaube
averyaube / error.php
Created May 3, 2011 20:16
Error Handling Controller
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Error extends Controller_Base {
public function before()
{
if ( ! method_exists($this, 'action_'.$this->request->action()))
{
// Default error message will be the 500
$this->request->action('500');
@averyaube
averyaube / exception.php
Created May 3, 2011 20:10
Kohana 3.1 Custom Error Handler
<?php defined('SYSPATH') or die('No direct script access.');
class Kohana_Exception extends Kohana_Kohana_Exception {
public static function handler(Exception $e)
{
if (Kohana::$environment === Kohana::DEVELOPMENT)
{
// If we are in development, show us the stack trace/etc
parent::handler($e);