ffmpeg -i ./input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos" -c:v pam \
-f image2pipe - | \
convert -delay 10 - -loop 0 -layers optimize output.gif
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/bash | |
# Script to find and follow logs of pods based on pattern matching | |
# Usage: ./kubectl-logs <part1> <part2> [part3] ... | |
# Example: ./kubectl-logs shl staging | |
# This will find pods matching: sieservice-shl-*-staging-* | |
NAMESPACE="sieservice" | |
# Check if at least one argument is provided |
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/bash | |
# | |
# generate sourcemap | |
# | |
# (android) | |
echo "🚀 Generating sourcemap for android..." | |
npx react-native bundle \ | |
--dev false \ | |
--minify false \ |
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/bash | |
# Exit on any error | |
set -e | |
# Check if kubectl is available | |
if ! command -v kubectl >/dev/null 2>&1; then | |
echo "Error: kubectl is not installed or not in PATH" | |
exit 1 | |
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
# Install WSL Ubuntu | |
# Using unzip tools | |
unzip -O GB18030 your_archive.zip -d target_dir |
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
// credit: https://www.reddit.com/r/VirtualYoutubers/comments/ifzqe7/i_made_a_live_timestamp_tool/ | |
(function () { | |
if (!document.querySelector("#ytls-pane")) { | |
var pane = document.createElement("div"); | |
var exit = document.createElement("span"); | |
var list = document.createElement("ul"); | |
var nowli = document.createElement("li"); | |
var nowa = document.createElement("a"); | |
var nowid; | |
var nowtext = document.createElement("input"); |
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 signal | |
import os | |
import hmac | |
import hashlib | |
import sys | |
def tle_handler(*args): | |
print('⏰') | |
sys.exit(0) |
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
# coding: utf-8 | |
# 自分の得意な言語で | |
# Let's チャレンジ!! | |
def min_adjacent_swap(arr): | |
swap_times = 0 | |
n = len(arr) / 2 | |
iter = 0 | |
while iter < len(arr) - 1: | |
# if current not ideal | |
if arr[iter] != iter % n: |
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
/** | |
require webp & libwebp, see https://developers.google.com/speed/webp/download | |
run: | |
cd working_dir # suppose working dir contains all webp that u want to convert | |
node ./convert.js # wait for it until done | |
*/ | |
const child = require("child_process"); | |
const fs = require("fs"); | |
const path = require("path"); | |
const util = require("util"); |
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/jquense/yup/issues/394 | |
import i18next from "i18next"; | |
import { setLocale } from "yup"; | |
export const setFormikLocale = (i18n: typeof i18next): void => { | |
// Config yup validation schema default error message | |
setLocale({ | |
mixed: { | |
notType: (_ref) => { |
NewerOlder