This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# if the script is running from a terminal, show colors | |
if [ -t 1 ]; then | |
STYLE_END="\033[m" | |
BLUE="\033[34m" | |
GREEN="\033[32m" | |
RED="\033[41m" | |
YELLOW="\033[43m\033[34m" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/davidshimjs/qrcodejs/ | |
Vue.directive('qrcode', function (data) { | |
Vue.nextTick(() => { | |
qrcodeOptions.text = typeof data === 'object' | |
? data.href || data.value || data.text | |
: data | |
new QRCode(this.el, qrcodeOptions) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Moment from 'moment' | |
Vue.directive('moment-ago', { | |
update (timestamp) { | |
this.el.innerHTML = Moment(timestamp).fromNow() | |
this.interval = setInterval(() => { | |
this.el.innerHTML = Moment(timestamp).fromNow() | |
}, 1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function greeklish($string) | |
{ | |
$replace_pairs = [ | |
'Α' => 'A', | |
'Ά' => 'A', | |
'Β' => 'V', | |
'Γ' => 'G', |