Skip to content

Instantly share code, notes, and snippets.

new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
}
})
import initMixin from './internal/init'
import stateMixin from './internal/state'
import eventsMixin from './internal/events'
import lifecycleMixin from './internal/lifecycle'
import miscMixin from './internal/misc'
import dataAPI from './api/data'
import domAPI from './api/dom'
import eventsAPI from './api/events'
import lifecycleAPI from './api/lifecycle'
@hectorlorenzo
hectorlorenzo / vue_1_1.js
Last active August 3, 2016 09:32
Vue.js Instance 1:1
function Vue (options) {
this._init(options)
}
// install internals
initMixin(Vue)
stateMixin(Vue)
eventsMixin(Vue)
lifecycleMixin(Vue)
miscMixin(Vue)
import ApiWrapper from './apiwrapper'
import JeevesAbstract from './JeevesAbstract'
import {EventEmitter} from 'events'
let Jeeves = Object.assign({}, JeevesAbstract, EventEmitter, {
items: {
businessSegments: []
},
namespace: 'BUSINESS_SEGMENTS',
import ConstantsWrapper from './constantsWrapper'
export default {
items: [],
/**
* We define a set of namespaced constants to avoid collision of EventEmitter
* between modules
*
* @return {Object} Dictionary of namespaced actions
@hectorlorenzo
hectorlorenzo / constantsWrapper.js
Created July 17, 2016 07:02
Simple constants wrapper for Dashboard project
export default function (namespace) {
return {
update: namespace + '.UPDATE',
ready: namespace + '.READY'
}
}
@hectorlorenzo
hectorlorenzo / ApiWrapper.js
Last active July 17, 2016 07:02
API Wrapper for the Dashboard project
let ApiCalls = {
businessId: '',
moduleId: '',
formId: '',
type: '',
parentId: '',
baseUrl: '//admin:d360staging@api.dashboard.v2.digital360.com.au/',
apiUrl: '',
/**
@hectorlorenzo
hectorlorenzo / SS_TextField.php
Created March 24, 2016 02:49
SilverStripe text field
$fieldName = new TextField('FieldName', 'Field name', null, 255);
@hectorlorenzo
hectorlorenzo / SS_BlankStripObject.php
Created March 24, 2016 02:47
SilverStripe blank Strip object
<?php
class ExampleStrip extends Strip
{
//-------------------------------------------- DB model
/**
* @var array
*/
private static $db = [
@hectorlorenzo
hectorlorenzo / wordpress-gitignore
Last active August 29, 2015 14:13
.gitignore file for fresh Wordpress installations
# ------------------------------------------
# GITIGNORE FOR WORDPRESS
# Really simple .gitignore for new Wordpress intallations.
# User created plugins or themes have to be manually included in it.
# ------------------------------------------
# Ignore everything except the wp-content folder (because it contains the themes
# and plugins), and the gitignore file itself
/*
!.gitignore