Skip to content

Instantly share code, notes, and snippets.

View zball's full-sized avatar

Zac Ball zball

  • Harrisburg, Pennsylvania
View GitHub Profile
public function testCanUpdateProductAlreadyInCart()
{
$client = static::createClient();
$client->request('POST', '/api/carts');
$client->request('POST', '/api/products', [
'name' => 'Foo',
'unit_price' => '500'
]);
$client->request('POST', '/api/products', [
doctrine:
dbal:
driver: pdo_sqlite
dbname: test_db
user: test
path: %kernel.root_dir%/../var/cache/sqlite.db.cache
memory: true
charset: utf8
<?php
namespace CloudPOS\Bundle\StoreBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Cart
@zball
zball / asyncExample
Created March 30, 2016 20:58
Async return value
function getPermissions(){
var permissions = $.Deferred();
FB.api(
"/{{ app.user.facebookID }}/permissions",
{
access_token: '{{ app.user.facebookAccessToken }}'
},
function (response) {
axios.interceptors.response.use(undefined, function (error) {
return new Promise(function(resolve, reject){
if(error.response.status == '401' && error.config){
axios.post(`${ROOT_URL}/app_dev.php/oauth/v2/token`, {
client_id: '3_68v87tczl8ws8088sgo80ckwcc4okow044o4o00084gkckogw8',
client_secret: '1fl4iu0t3uw0gco4socogocsswgkg8gcgs48oggcckw44kkks8',
grant_type: 'refresh_token',
refresh_token: localStorage.getItem('refresh_token')
import React, { Component } from 'react';
import Select from 'react-select';
import { connect } from 'react-redux';
import * as actions from '../actions'
import axios from 'axios'
class App extends Component {
componentWillMount(){
//this.props.getSelectOptions();
@zball
zball / BeerType.php
Created February 7, 2018 07:56
Upsert
<?php
namespace AppBundle\Form;
use AppBundle\Entity\Brewery;
use AppBundle\Entity\State;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\PercentType;