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
##################################### | |
# Some useful aliases for sharing. # | |
# Some by me, some found on the web # | |
##################################### | |
# Laravel Artisan | |
alias starthorizon='./artisan horizon' | |
alias stophorizon="kill \$(ps aux | grep 'php ./artisan horizon' | grep -v grep | head -n1 | awk '{print \$2}') 2> /dev/null && echo 'Horizon stopped'" | |
alias horizon='stophorizon; starthorizon;' |
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 debounce from 'lodash/debounce'; | |
import Vue from 'vue'; | |
// mobile longPress. usage: <div v-longpress="callbackFunction" /> you can specify an optional delay with v-longpress:1000="callbackFunction" (default is 300ms). | |
Vue.directive('longpress', { | |
bind(el, binding) { | |
let longPressTimeout = null; | |
el.addEventListener('touchstart', (e) => { | |
longPressTimeout = window.setTimeout(/*callback*/ binding.value, /*delay*/ binding.arg || 300); | |
}); |
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
/* | |
* Replaces all inline `require('path').default` with `import Name from 'path'` | |
* Adding them as imports to the top of the file. | |
* Usage: node RequireToImport.js dir [dry] | |
*/ | |
const glob = require("glob") | |
const path = require('path'); | |
const fs = require('fs'); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/awesome-qr/2.1.5-rc.0/awesome-qr.min.js" integrity="sha512-UpkZj9Z6XEPriWyGB7t7Hf4la5r6kLnxVzmjSpxqn9MFScD2m+m9QZyhKLOJW6lYTgGQB9UPEciaLizU0yZUeA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
<script> | |
async function generate(input) { | |
let file = input?.files?.[0]; | |
let logo = null; | |
if (file) { | |
logo = window.URL.createObjectURL(file); |
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
addEventListener("fetch", (event) => { | |
event.respondWith( | |
handleRequest(event.request).catch( | |
(err) => new Response(err.stack, { status: 500 }) | |
) | |
); | |
}); | |
const paused = false; |