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 ruby | |
require 'mini_magick' | |
# gem install mini_magick | |
def resize_image(image_name, output_name) | |
current_scale = 3 | |
if image_name.include?("@3x") | |
current_scale = 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
// ==UserScript== | |
// @name Python doc toc | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-04-27 | |
// @description Add table of contents to python doc. | |
// @author You | |
// @match https://docs.python.org/3/library/*.html | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=python.org | |
// @grant none | |
// @run-at document-idle |
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
payload: | |
- '+.openai.com' | |
- '+.sentry.io' | |
- '+.oaistatic.com' | |
- '+.livekit.cloud' | |
- '+.oaiusercontent.com' | |
- '+.ai.com' | |
- '+.openai.com.cdn.cloudflare.net' | |
- 'openaiapi-site.azureedge.net' | |
- 'openaicom-api-bdcpf8c6d2e9atf6.z01.azurefd.net' |
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
#!/bin/bash | |
if ! command -v ffmpeg &> /dev/null | |
then | |
echo "ffmpeg could not be found" | |
echo "installing ffmpeg" | |
apt install ffmpeg -y | |
fi | |
if ! command -v whisper &> /dev/null |
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 v2ex_cell | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description simplify timeline cell. | |
// @author 6david9 | |
// @match https://*.v2ex.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com | |
// @require https://code.jquery.com/jquery-3.6.3.min.js | |
// @run-at document-idle |
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 v2ex | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description remove background image. | |
// @author 6david9 | |
// @match https://*.v2ex.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com | |
// @grant none | |
// @run-at document-idle |
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 v2ex_comment | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description simplify comment cell. | |
// @author 6david9 | |
// @match https://*.v2ex.com/t/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com | |
// @require https://code.jquery.com/jquery-3.6.3.min.js | |
// @grant none |
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
{ | |
"title": "Custom shortcut", | |
"maintainer": "ly", | |
"rules": [ | |
{ | |
"description": "format code in xcode", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { |
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
# https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new | |
ffmpeg -c:v h264_cuvid -i "input.flv" -c:v h264_nvenc "output.mp4" | |
# add srt | |
ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4 | |
ffmpeg -i infile.mkv -i infile.srt -c copy -c:s srt outfile.mkv | |
# resize | |
ffmpeg -i input.avi -filter:v scale=720:-1 -c:a copy output.mkv | |
ffmpeg -c:a ac3 -c:v hevc_cuvid -i "input.ts" -filter:v scale=-1:1080 -c:a aac -c:v hevc_nvenc "output.mp4" |
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
#include <iostream> | |
#include <cairo/cairo.h> | |
#include <cairo/cairo-quartz.h> | |
int main(int argc, const char * argv[]) { | |
cairo_surface_t *surface = cairo_quartz_surface_create(CAIRO_FORMAT_RGB24, 320 * 3.0, 560 * 3.0); | |
cairo_t *cr = cairo_create(surface); | |
cairo_set_antialias(cr, CAIRO_ANTIALIAS_BEST); |
NewerOlder