Skip to content

Instantly share code, notes, and snippets.

View ibunubi's full-sized avatar

Ali Imron ibunubi

View GitHub Profile
@ibunubi
ibunubi / TableHeaderFilter.vue
Last active May 29, 2019 06:54
Kendo UI table header filter wanna be
<template>
<div class="th-filter">
<div class="icon" @click="filterVisibility = !filterVisibility">&nbsp;</div>
<form v-show="filterVisibility">
<div>
<label for="">{{ label }}</label>
<select v-model="filter.operator">
<option
v-for="operator in ops"
:value="operator.value"
@ibunubi
ibunubi / v-disabled
Last active May 13, 2019 02:52
Vue directive: prevent update for readonly (remove attributes with dev-tools case)
Vue.directive('disabled', {
bind(el) {
let hasDisabled = el.disabled;
if (hasDisabled) {
el.addEventListener('keydown', evt => evt.preventDefault());
}
},
unbind(el) {
let hasDisabled = el.disabled;
if (hasDisabled) {
@ibunubi
ibunubi / NumberSimplify.js
Last active May 10, 2019 07:49
Vue plugin for simplify number and return it with label
/*
* Example:
* input: 10000
* output: 10.000k
*/
export default {
install(Vue) {
Vue.prototype.$numberSimplify = (val, fraction) => {
let s = `${Math.round(val)}`,
@ibunubi
ibunubi / i18n.js
Last active January 9, 2019 03:33
Simple i18n as Vue plugin
export default {
install(Vue, opt = {}) {
// put lang file into public folder
let defaultOptions = { folder: '/lang' };
// add some new option
let options = Object.assign(defaultOptions, opt);
// define collection store
let store = new Vue({
data: {
@ibunubi
ibunubi / gen.vue
Last active February 28, 2018 04:35
function generator with Vue.js
<template>
<div>
</div>
</template>
<script>
export default {
methods: {
stepper: function* (i){
{
"manifestPort": 8000
}
@ibunubi
ibunubi / docker-compose.yml
Created October 5, 2017 16:39
yml file for docker php application
version: '3.1'
services:
memcached:
image: 'memcached:alpine'
container_name: php-docker-memcached
redis:
image: 'redis:alpine'
container_name: php-docker-redis
mariadb:
image: 'mariadb:10.1'
@ibunubi
ibunubi / composer.json
Created August 17, 2017 14:34
Get Holidays from Google Calendar
{
"require": {
"nesbot/carbon": "^1.22"
}
}