Skip to content

Instantly share code, notes, and snippets.

View steveclifton's full-sized avatar

Steve steveclifton

  • Realestate.co.nz
  • Auckland
View GitHub Profile

Keybase proof

I hereby claim:

  • I am steveclifton on github.
  • I am milocat (https://keybase.io/milocat) on keybase.
  • I have a public key whose fingerprint is 91EB A3C9 FDB9 1B75 5EA3 6332 BBEB 5231 7FFE 359D

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am steveclifton on github.
* I am milocat (https://keybase.io/milocat) on keybase.
* I have a public key ASCkskXmDWfczbHH5XcdcsLfi6QgQYyw84_VcQwsji68hwo
To claim this, I am signing this object:
@steveclifton
steveclifton / csrf.php
Last active February 12, 2019 03:52
Simple cross-site request forgery token php class
<?
class csrf {
/**
* Generates a new token
* @return [string] page name
*/
private static function getnewtoken($ps_page) {
import smbus
import sys
import time
from ctypes import c_short
from ctypes import c_byte
from ctypes import c_ubyte
if len(sys.argv) == 2:
DEVICE = int(sys.argv[1],16)
else:
@steveclifton
steveclifton / Foo.php
Last active August 11, 2021 03:59
FooListener Example
<?php
namespace AppBundle\EventListener;
use AppBundle\Entity\FooHistory;
use Doctrine\ORM\Event\PreUpdateEventArgs;
class FooListener
{
protected $entityManager;
@steveclifton
steveclifton / services.yml
Created August 11, 2021 03:43
Symfony Services FooListener Example
AppBundle\EventListener\FooListener:
arguments:
$entityManager: "@doctrine.orm.entity_manager"
tags:
- { name: 'doctrine.orm.entity_listener', event: 'preUpdate', entity: 'AppBundle\Entity\Foo' }
- { name: 'doctrine.orm.entity_listener', event: 'postUpdate', entity: 'AppBundle\Entity\Foo' }