Skip to content

Instantly share code, notes, and snippets.

View LeeSaferite's full-sized avatar

Lee Saferite LeeSaferite

  • Lake City, FL, US
View GitHub Profile
@LeeSaferite
LeeSaferite / srd_5e_monsters.json
Created September 22, 2018 16:33 — forked from tkfu/srd_5e_monsters.json
A JSON file with all the D&D 5e SRD monster data
[
{
"name": "Aboleth",
"meta": "Large aberration, lawful evil",
"Armor Class": "17 (Natural Armor)",
"Hit Points": "135 (18d10 + 36)",
"Speed": "10 ft., swim 40 ft. ",
"STR": "21",
"STR_mod": "(+5)",
"DEX": "9",
<?php
namespace Lokey\Fixes\Plugin\Magento\Framework\Reflection;
use Zend\Code\Reflection\MethodReflection;
class TypeProcessor
{
/**
* Fix handling of docblock return definitions
@LeeSaferite
LeeSaferite / main.go
Created January 7, 2018 16:16 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
<?php
function seconds_to_time(int $seconds) : string
{
return sprintf("%d:%02d:%02d", floor($seconds / 3600), (($seconds / 60) % 60), ($seconds % 60));
}
@LeeSaferite
LeeSaferite / xdebug_commandline.sh
Created July 13, 2016 12:42
Run PHP xdebug from the CLI
PHP_IDE_CONFIG='serverName=SOME_SERVER' php -d xdebug.remote_autostart=1 some_script.php

Keybase proof

I hereby claim:

  • I am LeeSaferite on github.
  • I am leesaferite (https://keybase.io/leesaferite) on keybase.
  • I have a public key whose fingerprint is 1835 8C99 6B55 F4F1 CAB6 8211 2BC1 C990 97B8 51FA

To claim this, I am signing this object:

Verifying that +leesaferite is my blockchain ID. https://onename.com/leesaferite
@LeeSaferite
LeeSaferite / Observer.php
Created October 2, 2015 13:24
Code to queue sales grid updates
<?php
class Aoe_QueuedOperations_Model_Observer
{
/**
* This is used to queue the sales grid updates
*
* NB: This should be attached to the sales_order_resource_update_grid_records event
*
*
* @see Mage_Sales_Model_Resource_Order_Abstract::updateGridRecords
@LeeSaferite
LeeSaferite / gist:b885e0359186241b09ff
Last active August 29, 2015 14:25
Parameter Encoder and Hasher
<?php
/**
* @param array $parameters
* @param string $secretKey
*
* @return string
*
* @throws InvalidArgumentException
*/
function prepareParameters(array $parameters, $secretKey)
@LeeSaferite
LeeSaferite / original.php
Last active August 29, 2015 14:13
Mage_CatalogInventory_Model_Stock_Item::suggestQty update
<?php
public function suggestQty($qty)
{
// We do not manage stock
if ($qty <= 0 || !$this->getManageStock()) {
return $qty;
}
$qtyIncrements = (int)$this->getQtyIncrements(); // Currently only integer increments supported
if ($qtyIncrements < 2) {