Skip to content

Instantly share code, notes, and snippets.

View benglass's full-sized avatar

Ben Glassman benglass

View GitHub Profile
// Normal action creator
function selectChart(chartId) {
return {
type: 'SELEcT_CHART',
id: chartId
}
}
dispatch(selectChart(5))
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_PASSWORD: example
volumes:
// Write some awesome Swift code, or import libraries like "Foundation",
// "Dispatch", or "Glibc"
// myProp as a required member variable with default of 0
struct MyStruct1 {
var myProp: Double = 0
}
let s1 = MyStruct1()
<?php
namespace Application\Search;
use Application\Model\Repository\BillRepositoryInterface;
use Application\Model\Repository\BillProfileRepositoryInterface;
class BillSearchResultBillProfileKeywordsDecorator implements BillSearchResultDecoratorInterface
{
protected $profileIds = [];
<?php
interface OptionalFieldInterface
{
public function getName();
public function getValue();
}
class OptionalField implements OptionalFieldInterface
{
GET /ksefocus_bglassman/bill/_search
{
"query": {
"terms": {
"categories": [
31, 33, 35, 36, 39, 40, 44, 45
]
}
},
"aggs": {
<?php
$loader = require_once __DIR__.'/app/bootstrap.php.cache';
require_once __DIR__.'/app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$kernel->boot();
$container = $kernel->getContainer();
$validator = $container->get('validator');
<?php
function index_by(array $arr, $getKey) {
return array_combine(array_map($getKey, $arr), $arr);
}
$emails = ['ben@vtdesignworks.com', 'bruce@ksefocus.com'];
$emailAddresses = $emailAddressRepository->findByEmails($emails);
$emailAddressesByEmail = index_by(
$emailAddresses,
<?php
// This is output <input type="email" />
$builder->add('email', 'email');
// This is output <input type="text" />
$builder->add('email', null);
// This is output <input type="tel" />
$builder->add('phone', null, array(
<?php
class MyTest
{
public function testSomething()
{
$crawler = $this->request('/foo');
$form = $this->findFormByButtonText('Save');
$data = array(