Skip to content

Instantly share code, notes, and snippets.


Simon Davies simondavies

View GitHub Profile
View laravel-pivot-seeder.php
use Illuminate\Database\Seeder;
class PostTagTableSeeder extends Seeder
* @var
private $pivotData = [];
simondavies / ReactJS-Cookie.js
Last active Mar 26, 2018
A React JS & ES2015 Cookies pop up component and example files
View ReactJS-Cookie.js
simondavies / VueJS-Cookies-message.js
Last active Jun 14, 2016
Example Combination of Vue JS with ES2015 style, using babelify to ports to the current ES5.
View VueJS-Cookies-message.js
* Cookies Pop Up Component
* A pop up to inform the user that cookies are used on a/this site.
* usage:
* <cookie></cookie>
* User Overwite the generic message and expiry days,
* add 'cookie-message' and/or 'days-to-expire' properties to the component
* <cookie
simondavies / CookiesPopup.js
Last active Aug 29, 2015
ES6 Class for UK Cookies Message pop up
View CookiesPopup.js
"use strict";
* CookiesPopup
* a simple class to check for, set, a cookie if not currently set,
* and inform the user that cookies are present
* set up some private vars
simondavies / TestService.js
Last active Aug 29, 2015
Gulp, Browserify & Angular Test Set Up
View TestService.js
module.exports = function($http, $q, $log) {
return {
getStores : function(){
var deferred = $q.defer();
$http({method: 'GET', url : 'api/stores'})
.success(function(data, status, headers, config) {deferred.resolve(data) })
.error(function(data, status, headers, config) { deferred.reject(status);});
return deferred.promise;
View gist:e00946ae1ed64d7ce275
* Simple JS Class Set up and usage
var MyClassName = (function(){
* Add variable here public and private
* I use an underscore for my private variables to separate them visually