Skip to content

Instantly share code, notes, and snippets.

View simondavies's full-sized avatar

Simon Davies simondavies

View GitHub Profile
<?php
use Illuminate\Database\Seeder;
class PostTagTableSeeder extends Seeder
{
/**
* @var
*/
private $pivotData = [];
@simondavies
simondavies / ReactJS-Cookie.js
Last active August 13, 2021 11:36
A React JS & ES2015 Cookies pop up component and example files
@simondavies
simondavies / VueJS-Cookies-message.js
Last active June 14, 2016 09:02
Example Combination of Vue JS with ES2015 style, using babelify to ports to the current ES5.
/**
* 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
simondavies / CookiesPopup.js
Last active August 29, 2015 14:23
ES6 Class for UK Cookies Message pop up
"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
simondavies / TestService.js
Last active August 29, 2015 14:03
Gulp, Browserify & Angular Test Set Up
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;
},
@simondavies
simondavies / gist:e00946ae1ed64d7ce275
Created March 8, 2012 22:51
Javascript: Basic Class
/**
* 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
*/