Skip to content

Instantly share code, notes, and snippets.

View mattwellss's full-sized avatar

Matthew Wells mattwellss

View GitHub Profile
<?php
namespace Lfi\Codetools\PHPStan;
use Laminas\Code\Generator\DocBlock\Tag\ParamTag;
use Laminas\Code\Generator\DocBlock\Tag\ReturnTag;
use Laminas\Code\Generator\DocBlockGenerator;
use Laminas\Code\Generator\InterfaceGenerator;
use Laminas\Code\Generator\MethodGenerator;
use Magento\Framework\Api\SimpleDataObjectConverter;
@mattwellss
mattwellss / Observer.php
Last active December 25, 2016 18:50
Some MageStache Examples
<?php
namespace MattWellss\MageStache;
use Mage;
class Model_Observer
{
/**
* @param \Varien_Event_Observer $observer
<?php
// For use with really dumb simple php -S
if ($_SERVER['REQUEST_URI'] !== '/') {
return false;
}
$tmpl = <<<MUSTACHE
{{#enabled}}
do_a_thing(function (value) {
value += 1;
});
alert(value);
@mattwellss
mattwellss / rdio.sh
Created January 21, 2015 22:53 — forked from colby/rdio.sh
#!/usr/bin/env bash
if ! pgrep -q Rdio
then
echo "Error: Rdio is not running"; exit 1
fi
function check {
which "$1" || echo "Missing dep: $1"; exit 1
}
@mattwellss
mattwellss / rdio.sh
Last active August 29, 2015 14:13 — forked from colby/rdio.sh
#!/usr/bin/env bash
if ! pgrep -q Rdio
then
echo "Error: Rdio is not running"; exit 1
fi
function check {
which "$1" || echo "Missing dep: $1"; exit 1
}
require 'listen'
listener = Listen.to('./watchme') do |m, c, d|
puts "modified: #{m}"
puts "created: #{c}"
puts "deleted: #{d}"
end
listener.start
<config>
<!-- other nodes -->
<stores>
<default>
<web>
<unsecure>
<base_url><![CDATA[http://url/]]></base_url>
</unsecure>
<secure>
<base_url><![CDATA[https://url/]]></base_url>
@mattwellss
mattwellss / index.html
Created March 26, 2014 19:16
Fancy dropdowns
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div class="fancy-select">
<select>
<option value="1">First Option</option>
<option value="2">Second Option</option>
<?php
require 'app/Mage.php';
$boris = new \Boris\Boris('mage> ');
$boris->setLocal(array('app' => Mage::app()));
$boris->start();