Skip to content

Instantly share code, notes, and snippets.

View mdunbavan's full-sized avatar

Mark Dunbavan mdunbavan

View GitHub Profile
@mdunbavan
mdunbavan / PostController.php
Created September 1, 2015 09:31
object and array data
<?php
foreach(Post::all() as $postObject){
$start_time = $postObject['post_create_time'];
$end_time = $postObject['post_ended_time'];
$postData =
array(
'post' => 'title',
'start_time' => $start_time,
'end_time' => $end_time
@mdunbavan
mdunbavan / craft-localization-nginx
Created September 21, 2016 15:17 — forked from cmalven/craft-localization-nginx
nginx config for Craft CMS localization
server {
listen 80;
server_name site.production.designcompany.com;
root /home/forge/site.production.designcompany.com/public;
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript image/svg+xml text/xml text/css;
Markmacbook168:build mdunbavan$ npm install gulp-sass --save-dev
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> [email protected] install /Freelance/projects/valeriewade/build/node_modules/gulp-sass/node_modules/node-sass
> node build.js
(node:86110) DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.
CXX(target) Release/obj.target/binding/binding.o
@mdunbavan
mdunbavan / books.json
Created November 15, 2016 15:44
Book List
[
{
"author": {
"avatar": "http://lorempixel.com/250/250/",
"name": "JRR Tolkein"
},
"cover": "http://lorempixel.com/500/700/",
"description": "WH Auden thought this tale of fantastic creatures looking for lost jewellery was a \"masterpiece\".",
"genre": {
"category": "Non-Fiction",
@mdunbavan
mdunbavan / index.html
Last active February 7, 2017 20:13
Vuejs base
<section id="home-container" class="parralex-scroll">
<router-view></router-view>
</section>
@mdunbavan
mdunbavan / vuejs.js
Created February 10, 2017 09:03
vue js routes
const PeopleListing = ('people-listing', {
template: '#people-listing-template',
delimiters: ['${', '}'],
data: function() {
return {
products: []
}
},
mounted: function() {
this.getAllProducts();
@mdunbavan
mdunbavan / console.log
Last active February 16, 2017 14:40
VUEX example within template
[Vue warn]: Property or method "products" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
(found in root instance)
warn @ vue.min.js?2584471148241169295:525
warnNonPresent @ vue.min.js?2584471148241169295:1443
has @ vue.min.js?2584471148241169295:1475
(anonymous) @ VM4692:2
Vue._render @ vue.min.js?2584471148241169295:2220
updateComponent @ vue.min.js?2584471148241169295:2613
get @ vue.min.js?2584471148241169295:2936
run @ vue.min.js?2584471148241169295:3005
@mdunbavan
mdunbavan / index.js
Created February 22, 2017 15:54
veux orderby
const store = new Vuex.Store({
state: {
products: [
],
posts: []
},
mutations: {
addProducts (state, product) {
// mutate state
state.products.push(product)
@mdunbavan
mdunbavan / index.js
Created February 24, 2017 14:52
Swiper Vue Plugin
const ListComp = {
template: `
<div class="wrapper grid" id="start-parralex">
<div class="grid__item large--one-third medium--one-whole no-padding" v-for="(key, index) in productsOrderBy">
<swiper :options="swiperOption">
<swiper-slide v-for="slide in swiperSlides">I'm Slide {{ slide }}</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
'use strict';
function findUpTag(el, tag) {
while (el.parentNode) {
el = el.parentNode;
if (el.tagName === tag)
return el;
}
return null;
}