Skip to content

Instantly share code, notes, and snippets.

Zac Ball zball

  • andculture
  • Harrisburg, Pennsylvania
Block or report user

Report or block zball

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View BeerType.php
<?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;
View react-select examples
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();
View refresh_token.js
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')
@zball
zball / asyncExample
Created Mar 30, 2016
Async return value
View asyncExample
function getPermissions(){
var permissions = $.Deferred();
FB.api(
"/{{ app.user.facebookID }}/permissions",
{
access_token: '{{ app.user.facebookAccessToken }}'
},
function (response) {
View Cart.php
<?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
View config_test.yml
doctrine:
dbal:
driver: pdo_sqlite
dbname: test_db
user: test
path: %kernel.root_dir%/../var/cache/sqlite.db.cache
memory: true
charset: utf8
View Test Example
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', [
You can’t perform that action at this time.