Skip to content

Instantly share code, notes, and snippets.

View iampersistent's full-sized avatar

Rich Shank iampersistent

View GitHub Profile
@dunglas
dunglas / example.php
Created April 19, 2018 06:25
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}
@lgstianwen
lgstianwen / ESE
Last active August 29, 2015 14:06
Special needs code
id code name
C OI Orthopedically Impaired
F SI Speech Impaired
G LI Language Impaired
H DHH Deaf or Hard of Hearing
I VI Vi
J E/BD Emotional/Behavioral Disability
K SLD Specific Learning Disability
L L Gifted
@aaronlerch
aaronlerch / README.md
Created August 7, 2013 16:46
Upstart scripts for MongoDB Monitoring Service agent (MMS) MongoDB Backup Service agent (MBS?)

Download

Download and install the agent(s). These examples are on a standard 64-bit Amazon EC2 Linux AMI.

MMS

wget [path to mms agent download, specified by 10gen]
sudo tar xvzf 10gen-mms-agent-[CUSTOM_NAME].tar.gz -C /opt
@merk
merk / Menu.php
Created May 7, 2012 03:15
Event driven menus
<?php
/*
* TODO: Copyright notices on Infinite Networks files.
*
* (c) Infinite Networks Pty Ltd <http://www.infinite.net.au/>
*/
namespace Infinite\MenuBundle\Menu;
@mrflory
mrflory / Builder.php
Created April 1, 2012 20:24
Twitter Bootstrap Twig Template for KnpMenuBundle in Symfony2
<?php
namespace Linkofy\CommonBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class Builder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)
@akgupta
akgupta / localStorageSync.js
Created March 12, 2012 04:20
Overriding backbone sync to use local storage
// overriding sync to use local storage when possible
sync : function(method, model, options){
var key, now, timestamp, refresh;
if(method === 'read' && this.constants.isStoredInLocalStorage) {
// only override sync if it is a fetch('read') request
key = this.getKey();
if(key) {
now = new Date().getTime();
timestamp = $storage.get(key + ":timestamp");
refresh = options.forceRefresh;
@inspiran
inspiran / pricing.twig
Created February 7, 2012 23:20
Vespolina pricing declaration based on twig alike syntax
{% pricingSet "packable_product" %}
{% element "packaging_cost" %}
{% element "net_value" %}
{% element "net_value_with_packaging_cost" %}
{% element "tax_amount" %}
{% element "unit_price_with_tax" %}
{% endpricingset %}
{% pricingSet "cart_item" %}
{% element "total_discount" %}
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@beberlei
beberlei / MyWebTestCase.php
Created September 17, 2011 12:14
Easily Inject authenticated Symfony User into functional test
<?php
use Liip\FunctionalTestBundle\Test\WebTestCase;
use Symfony\Component\HttpKernel\Profiler\Profiler;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @group functional
*/