Skip to content

Instantly share code, notes, and snippets.

@ecmel
ecmel / VCurrencyField.vue
Created June 7, 2018 19:50 — forked from Christilut/VCurrencyField.vue
Vuetify Currency Field
<template lang="pug">
v-text-field(
ref='field',
:prefix='prefix',
v-model='model',
@focus='onFocus',
@keyup='onKeyUp',
:error-messages='errorMessages',
v-bind='$attrs',
@change='onChange'
@ecmel
ecmel / select-file.vue
Last active December 20, 2021 09:17
Vuetify Multiple File Select and Preview
<script>
export default {
name: 'VSelectFile',
model: {
prop: 'value',
event: 'change'
},
props: {
label: {
type: String,
@ecmel
ecmel / file-btn.vue
Last active January 17, 2018 19:03
Vuetify file selection button
<script>
export default {
name: 'VFileBtn',
props: {
value: {
type: File,
default: null
},
accept: {
type: String,
@ecmel
ecmel / Toastr.vue
Last active February 19, 2018 12:25
Pure Vue Bootstrap 4 Toastr
<script>
export default {
data() {
return {
toasts: [],
timeout: 3000
}
},
created() {
this.$root.$on('toast', this.toast)
function Deferred(data) {
this.data = data || {}
this.promise = new Promise((resolve, reject) => {
this.resolve = resolve
this.reject = reject
})
Object.freeze(this)
}
@ecmel
ecmel / Maxios.js
Last active November 7, 2017 10:44
Mock adapter for axios
import Deferred from './Deferred'
function Maxios(axios) {
this.axios = axios
this.adapter = axios.defaults.adapter
}
Maxios.prototype.pending = {}
Maxios.prototype.init = function () {
@ecmel
ecmel / simple-pagination.js
Last active March 24, 2017 20:42 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
function pagination(c, m) {
const current = c,
last = m,
delta = 2,
left = current - delta + 1,
right = current + delta + 2,
range = [],
rangeWithDots = []
let l
@ecmel
ecmel / PDFlowStream.java
Last active October 1, 2019 18:56
PDFBox 2 Text Helper
package portal.core;
import java.awt.Color;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.Deque;
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
@ecmel
ecmel / wildfly-install.sh
Last active June 7, 2016 13:41 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 9.x as service in Linux
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 9.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :20150726
#usage :/bin/bash wildfly-install.sh
WILDFLY_VERSION=9.0.1.Final
WILDFLY_FILENAME=wildfly-$WILDFLY_VERSION