This file contains 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
// ==UserScript== | |
// @name Video Speed Control with Keyboard | |
// @description Decrease and increase HTML video playback speed with "," and ".". Remembers and applies speeds across page-loads. | |
// @version 2024-11-08 | |
// @author Vitus Schuhwerk | |
// @license MIT | |
// @homepageURL https://gist.githubusercontent.com/schuhwerk/67fb4da50652681b857002e1ba2bf071 | |
// @updateURL https://gist.githubusercontent.com/schuhwerk/67fb4da50652681b857002e1ba2bf071/raw | |
// @downloadURL https://gist.githubusercontent.com/schuhwerk/67fb4da50652681b857002e1ba2bf071/raw | |
// @grant GM_getValue |
This file contains 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
// ==UserScript== | |
// @name Link Error Overlay to VS Code | |
// @homepageURL https://gist.github.com/schuhwerk/c2cd7b4e2b40c462473d6142d15a7140 | |
// @version 2024-06-20 | |
// @description create-react-app (https://github.com/facebook/create-react-app) comes with an error-overlay (which shows links to files). this script links those to your local vscode. | |
// @author Vitus Schuhwerk | |
// @match http://localhost:*/* | |
// @updateURL https://gist.githubusercontent.com/schuhwerk/c2cd7b4e2b40c462473d6142d15a7140/raw | |
// @downloadURL https://gist.githubusercontent.com/schuhwerk/c2cd7b4e2b40c462473d6142d15a7140/raw | |
// @grant GM_getValue |
This file contains 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
// use the strings in an array as types. | |
const animals = ["cat", "dog", "mouse"] as const | |
type Animal = (typeof animals)[number] // transformer like "cat" | "dog" | ... | |
let myAnimal : Animal = "cat" // <- autocomplete works here | |
// merge two types. | |
type Prefix = "sub_" | |
type Numbers = 0 | 1 | 2 | 3 | 4 | 5 | |
type SubNumbers = `${Prefix}${Numbers}` // transforms to sub_1 | sub_2 | ... | |
let myNumber : SubNumbers = "sub_0" // <- autocomplete works here |
This file contains 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
const stringToBool = (s: string) => (s.toString().match(/^(true|[1-9][0-9]*|[0-9]*[1-9]+|yes)$/i) ? true : false) | |
type levelNames = "emerg" | "alert" | "crit" | "error" | "warn" | "notice" | "info" | "debug" | |
type logLevel = { | |
name: levelNames | |
cb: CallableFunction | |
defaultEnabled: boolean | |
} | |
type callableNames = { | |
[K in levelNames]: CallableFunction |
This file contains 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
// Keys in R overwrite the ones in Default. | |
type Modify<Default, R> = Omit<Default, keyof R> & R | |
// get only types where key is prefixed with Prefix. | |
type FilterPrefixed<O, Prefix extends string> = { | |
[K in keyof O as K extends `${Prefix}${infer _}` ? K : never]: O[K] | |
} | |
/** | |
* Object-Keys that are not prefixed with "_" become partials. |
This file contains 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
# Do this step by step. | |
# WSL: https://learn.microsoft.com/de-de/windows/wsl/install | |
# Trellis-Cli: https://github.com/roots/trellis-cli | |
# install brew (packet manager) - Just for trellis-cli. | |
# If you don't have already probably easier to just download and add to Path... | |
sudo apt update | |
sudo apt-get install build-essential curl file git | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" |
This file contains 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
/* | |
* Get last login time of WordPress users. | |
* WordPress stores the last time a user logged in in a serialized array in the usermeta - table. | |
* Your prefix might be different (xyz_usermeta instead of wp_usermeta). | |
* @see https://shocksolution.com/2019/04/16/find-last-login-time-for-wordpress-users-in-the-sql-database/ | |
*/ | |
select | |
wu.user_login, | |
metatable.*, | |
FROM_UNIXTIME(metatable.login_time) |
This file contains 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
#!/usr/bin/env bash | |
# Original Author Mike https://guides.wp-bullet.com | |
# Edited by Vitus Schuhwerk | |
# Purpose - Convert MyISAM tables to InnoDB with WP-CLI | |
# You can run multiple instances of this like this: | |
# - "bash scriptname 4 0" convert tables 0, 4, 8, ... | |
# - "bash scriptname 4 1" convert tables 1, 5, 9, ... | |
# - "bash scriptname 4 2" convert tables 2, 6, 10, ... | |
# - "bash scriptname 4 3" convert tables 3, 7, 11, ... |
This file contains 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
{ | |
"name": "spaces/more-composer-dependencies", | |
"repositories": [ | |
{ | |
"type": "composer", | |
"url": "https://wpackagist.org" | |
} | |
], | |
"require": { | |
"wpackagist-plugin/acf-to-rest-api": "3.*", |
This file contains 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
{ | |
"name": "spaces/more-composer-dependencies", | |
"require": { | |
"psr/container": "^1.0" | |
} | |
} |
NewerOlder