Skip to content

Instantly share code, notes, and snippets.

import React from 'react'
import { Route, Link } from 'react-router-dom'
const TabLink = ({ to, exact, title }) => (
<Route path={to} exact={exact} children={({ match }) => (
<li className={`nav-item ${match ? 'active' : ''}`}>
<Link to={to} className='nav-link' role='tab'>{title}</Link>
</li>
)} />
)
class Container {
constructor () {
this._definitions = {}
}
register (id, func, factory = false) {
if (typeof func !== 'function') {
throw new Error('Invalid service function.')
}
this._definitions[id] = {
@dadamssg
dadamssg / companies.json
Last active February 6, 2017 19:06
Ember-Data Tutorial
{
"companies": [
{
"id": "1",
"created_at": "2013-12-09 00:57:49",
"updated_at": "2013-12-09 00:57:49",
"name": "Acme Corp",
"links": {
"tasks": "/companies/1/tasks",
"people": "/companies/1/people"
<?php
namespace YourCompany\YourProject\UserBundle\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use FOS\UserBundle\Controller\SecurityController as BaseController;
class SecurityController extends BaseController
{
## Begin Server manifest
if $server_values == undef {
$server_values = hiera('server', false)
}
# Ensure the time is accurate, reducing the possibilities of apt repositories
# failing for invalid certificates
include '::ntp'
---
vagrantfile-local:
vm:
box: debian-wheezy72-x64-vbox43
box_url: 'http://box.puphpet.com/debian-wheezy72-x64-vbox43.box'
hostname: null
network:
private_network: 12.12.12.12
forwarded_port:
cPYJvJD3If7Q:
[CUSTOM]
error_reporting=-1
session.save_path=/var/lib/php/session
date.timezone=America/Chicago
display_errors=true
[XDEBUG]
xdebug.remote_connect_back=0
xdebug.default_enable=1
xdebug.remote_autostart=0
xdebug.remote_enable=0
security:
encoders:
MyCompany\MyProject\UserBundle\Entity\User:
algorithm: sha1
encode_as_base64: false
iterations: 1
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
<?php
$obj = new \stdClass;
$obj->x = '';
$gen1 = function() use ($obj) {
$obj->x .= ' 1 ';
yield;
$obj->x .= ' 2 ';
<?php
namespace Acme\DemoBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Acme\DemoBundle\Form\ContactType;
// these import the "@Route" and "@Template" annotations
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;