Skip to content

Instantly share code, notes, and snippets.

View ekwoster's full-sized avatar
🇺🇦

Yevhen Kozachenko ekwoster

🇺🇦
View GitHub Profile
@ekwoster
ekwoster / force_vue3_devtools.js
Last active February 20, 2023 19:23
Vue3 force vue.tools on prod
const app = Array.from(document.querySelectorAll('*')).find((e) => e.__vue_app__).__vue_app__
const version = app.version
const devtools = window.__VUE_DEVTOOLS_GLOBAL_HOOK__
devtools.enabled = true
devtools.emit('app:init', app, version, {})
/** Source: https://mokkapps.de/vue-tips/force-enable-vue-devtools-in-production-build/ */
/** After this code press Option+R on Mac */
@ca0v
ca0v / debounce.ts
Last active June 19, 2024 11:20
Typescript Debounce
// ts 3.6x
function debounce<T extends Function>(cb: T, wait = 20) {
let h = 0;
let callable = (...args: any) => {
clearTimeout(h);
h = setTimeout(() => cb(...args), wait);
};
return <T>(<any>callable);
}
@samhernandez
samhernandez / customroutes.php
Last active August 20, 2024 20:30
A simple class to add custom routes to Wordpress.
<?php
/**
* NOTE: This gist is very old. You might want to check out recent forks
* like this one: https://github.com/Alexlytle/Wordpress_custom_route/blob/main/Wordpress_Custom_route.php
* (thanks @Alexlytle) If you have an improvement to this gist, please
* post a link in a comment for others who might benefit. Thanks!
*
* A class to create simple custom routes.
*
@bfricka
bfricka / package.json
Created March 28, 2013 06:42
Package.json Boilerplate
{
"name": "",
"description": "",
"version": "0.0.0",
"private": true,
"author": "Brian Frichette",
"homepage": "",
"contributors": [ "Brian Frichette <brian.frichette@gmail.com> (https://github.com/brian-frichette)" ],
"bugs": { "url": "" },
"scripts": { "start": "nodemon app.js" },