Skip to content

Instantly share code, notes, and snippets.

View jmsfwk's full-sized avatar

James Fenwick jmsfwk

View GitHub Profile
<?php
use Phalcon\Di\InjectionAwareInterface;
use Phalcon\DiInterface;
class EbayClient extends SoapClient implements InjectionAwareInterface
{
protected $di;
working_item = {
"Item": {
"AutoPay": "true",
"CategoryMappingAllowed": "true",
"ConditionID": 1000,
"Country": "US",
"Currency": "USD",
"Description": """<![CDATA[<div><div class="productDescriptionWrapper"> lithium polymer batteries <div class="emptyClear"> </div> </div><div id="featu
re-bullets" class="a-section a-spacing-medium a-spacing-top-small"><ul class="a-vertical a-spacing-none"><li><span class="a-list-item"> Special design,High quality electric cell ! Say goodbye to dead digital devices !</span></li></ul><
/div></div>]]>""",
@jmsfwk
jmsfwk / config.json
Created April 19, 2016 10:39 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@jmsfwk
jmsfwk / validators.py
Created May 26, 2016 11:21
Django FileTypeValidator
from django.core.validators import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _
@deconstructible
class FileTypeValidator(object):
"""
Validates that an uploaded file has an allowed extension.
@jmsfwk
jmsfwk / validators.py
Created May 26, 2016 11:22
Django FileTypeValidator
from django.core.validators import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _
@deconstructible
class FileTypeValidator(object):
"""
Validates that an uploaded file has an allowed extension.
@jmsfwk
jmsfwk / styles.less
Created July 15, 2016 22:15
Atom styles for Monoisome in html
atom-text-editor {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-webkit-font-feature-settings: "liga" on, "calt" on;
}
atom-text-editor[data-grammar*="text html"] {
font-family: Monoisome;
}
@jmsfwk
jmsfwk / .profile
Created August 11, 2016 08:58
Homestead shell function
function homestead() {
( cd ~/Homestead && vagrant $* )
}
function art() {
( php artisan $* )
}
@jmsfwk
jmsfwk / pimpmypix.json
Created September 9, 2016 19:49
JSON-LD for Pimp My Pix
{
"@context": "http://schema.org",
"@type": "LocalBusiness",
"currenciesAccepted": "GBP",
"paymentAccepted": "Cash, Credit Card, Debit Card, BACS",
"openingHours": "Mo-Su",
"name": "Pimp My Pix",
"url": "https://www.pimpmypix.co.uk",
"email": "[email protected]",
"sameAs": [
@jmsfwk
jmsfwk / ruleset.xml
Created September 30, 2016 11:25
Laravel PHPMD ruleset
<?xml version="1.0"?>
<ruleset name="Clean Code Rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
The Clean Code ruleset contains rules that enforce a clean code base. This includes rules from SOLID and object calisthenics.
@jmsfwk
jmsfwk / List.php
Created November 16, 2016 10:12
Single type array class in PHP
<?php
final class List implements ArrayAccess
{
protected $type;
protected $array = [];
function __construct($var)
{