Skip to content

Instantly share code, notes, and snippets.

@stones
stones / Auth.php
Created October 9, 2015 03:03
A login script for laravel 5.1 and behat
<?php
use Illuminate\Encryption\Encrypter;
trait Auth
{
/**
* @Given I am not not logged in
*/
public function iAmNotNotLoggedIn()
// Attempting to pass data from 1 child to a separate child of the one parent.
// Is this retarded ?
class Workspace extends Component {
state = {current: 'test'};
setCurrentState(component) {
this.setState({current: component.props.data.title});
}
render() {
Chrome 45.0.2454 (Mac OS X 10.10.5) LOG: ' expected: |-'
Chrome 45.0.2454 (Mac OS X 10.10.5) LOG: ' { _context: {}, _owner: null, _store: { originalProps: { children: { _context: {}, _owner: null, _store: { originalProps: [Object], props: [Object] }, key: null, ref: null, type: 'div' }, className: 'inventory' }, props: { children: { _context: {}, _owner: null, _store: { originalProps: [Object], props: [Object] }, key: null, ref: null, type: 'div' }, className: 'inventory' } }, key: null, ref: null, type: 'div' }'
Chrome 45.0.2454 (Mac OS X 10.10.5) LOG: ' actual: |-'
Chrome 45.0.2454 (Mac OS X 10.10.5) LOG: ' { _context: {}, _owner: null, _store: { originalProps: { children: { _context: {}, _owner: null, _store: { originalProps: [Object], props: [Object] }, key: null, ref: null, type: 'div' }, className: 'inventory' }, props: { children: { _context: {}, _owner: null, _store: { originalProps: [Object], props: [Object] }, key: null, ref: null, type: 'div' }, className: 'inventory' } }, key: null
@stones
stones / gist:2ea290680c21045711ba
Created July 29, 2015 03:28
DeLorean Tutorial
document.getElementById('addItem').onclick = function () {
ActionCreator.addItem();
};
var ActionCreator = {
addItem: function () {
// We'll going to call dispatcher methods.
MyAppDispatcher.addItem({random: Math.random()});
}
};
var gulp = require('gulp'),
del = require('del'),
less = require('gulp-less'),
gutil = require('gulp-util'),
coffee = require('gulp-coffee'),
uglify = require('gulp-uglify'),
notify = require('gulp-notify'),
minifycss = require('gulp-minify-css'),
autoprefixer = require('gulp-autoprefixer'),
gulpFilter = require('gulp-filter'),
@stones
stones / package.json
Created July 4, 2014 00:32
Laravel Grunt Json
{
"name": "Tom.Stones.Packages",
"version": "1.0.0",
"devDependencies": {
"grunt" : "~0.4.1",
"grunt-php" : "~0.3.0",
"grunt-csso" : "~0.5.0",
"grunt-manifest" : "~0.4.0",
"grunt-contrib-concat" : "~0.1.3",
"grunt-contrib-uglify" : "~0.2.0",