Skip to content

Instantly share code, notes, and snippets.

View ais-one's full-sized avatar
💭
💻 At Work

Aaron Gong ais-one

💭
💻 At Work
View GitHub Profile
@ais-one
ais-one / Author.vue
Last active July 24, 2019 02:29
Vue-Crud-X Sample
<template>
<div>
<v-layout row wrap>
<v-flex xs12>
<!--
This is the CRUD Component
ref: to allow access to the component methods and data
parentId: not Null indicates the parent ID
v-bind: see script for explnation of the various properties used in this example
-->
<template>
<div>
<loading-blocker :loading="loading"></loading-blocker>
<h1>Test</h1>
<button @click="block">Click To Turn On Blocker This Cannot Be Clicked When Blocker Is Up</button>
</div>
</template>
<script>
import '@/vcx-loading-blocker.js'
import { LitElement, html, css } from 'lit-element'
class LoadingBlocker extends LitElement {
static get styles () {
return css`
#overlay {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100vh;
background: rgba(0,0,0,0.75);
@ais-one
ais-one / Page.vue
Last active January 30, 2019 23:41
vue-crud-x - Page.vue
<template>
<div id="not-needed">
<v-layout row wrap>
<v-flex xs12>
<vue-crud-x ref="book-pages-table" storeName="book-pages-table" :parentId="parentId" v-bind="pageDefs">
<template slot="filter" slot-scope="{ filterData, parentId, storeName }">
<div>{{ storeName }} ( HasParent: {{ !!parentId }}) {{ filterData }}</div>
</template>
<template slot="form" slot-scope="{ record, parentId, storeName }">
<div>
@ais-one
ais-one / Book.vue
Last active March 14, 2019 23:25
vue-crud-x - Book.vue
<template>
<div id="not-needed">
<v-layout row wrap>
<v-flex xs12>
<vue-crud-x ref="book-table" storeName="book-table" :parentId="null" v-bind="bookDefs" @form-open="openBookForm">
<template slot="filter" slot-scope="{ filterData, parentId, storeName }">
<h1>Custom {{ storeName }} Filter Slot</h1>
<div v-for="(filter, index) in filterData" :key="index">
<component :is="filter.type" v-model="filter.value" v-bind="filter.attrs"></component>
</div>
@ais-one
ais-one / HelloWord.html
Created April 30, 2017 16:05
NASA Space Apps Challenge 2017 Code
<!--
https://github.com/abwood/d3cesium
https://opensky-network.org/apidoc/rest.html
https://www.w3.org/TR/geolocation-API/
https://dev.w3.org/geo/api/spec-source.html#heading
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
@ais-one
ais-one / om.leafletjs.html
Created September 12, 2015 14:58
onemap.sg on Openlayers v3 & LeafletJS
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<style>
#map { width:640px; height:480px; }
</style>
<script src="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<div id="map"></div>
<script type="text/javascript">
var basemap;
var center = [1.355,103.840];
var map2015 = L.tileLayer('http://e1.onemap.sg/arcgis/rest/services/SM256WGS84/MapServer/tile/{z}/{y}/{x}');
<?php
// Adds bootstrap to LazyMofo - https://github.com/lazymofo/datagrid
// Refer to this fork - https://github.com/ais-one/datagrid
/*
-- sample sql script to populate database for demo
create table if not exists country
( country_id int unsigned not null auto_increment primary key
, country_name varchar(255)
) character set utf8 collate utf8_general_ci;