Skip to content

Instantly share code, notes, and snippets.

@ipcjs
ipcjs / vf_sub.lua
Last active October 26, 2023 18:46
支持通过快捷键,装载滤镜型次字幕的mpv脚本
--[[
SOURCE_ https://github.com/mpv-player/mpv/blob/master/TOOLS/lua/autoload.lua
COMMIT_ 3ba446d0b065f867ca262a2e05e4e8d24c7c0783
SOURCE_ https://github.com/rossy/mpv-open-file-dialog/blob/master/open-file-dialog.lua
COMMIT_ 04fe818fc703d8c5dcc3a6aabe1caeed8286bdbb
文档_ https://github.com/hooke007/MPV_lazy/discussions/106
示例:在 input.conf 中另起写入下列内容
Ctrl+Alt+1 script-binding vf_sub/append_vfSub # 装载次字幕(滤镜型)
Ctrl+Alt+2 script-binding vf_sub/append_vfSub_2 # 装载文件中的第2个字幕(滤镜型)
@echo off
setlocal enabledelayedexpansion
rem Generated by JetBrains Toolbox 1.25.12627 at 2022-09-07T17:07:44.532710200
rem force use c:\github\@flutter, @see: https://github.com/flutter/flutter/issues/105395
set "old_dir=%cd%"
if /i "%cd:~0,18%" == "k:\github\@flutter" (
cd /d %cd:k:\github=c:\github%
echo switch work dir from %old_dir% to !cd!...
)
@ipcjs
ipcjs / karabiner.rules.json
Last active January 5, 2023 05:35
ipcjs's Karabiner Custom Rules
{
"title": "@ipcjs's Karabiner Custom Rules",
"rules": [
{
"description": "Cmd(+Shift)+Home/End => Cmd(+Shift)+Up/Down (Jump to Start/End on Chrome's Page)",
"manipulators": [
{
"conditions": [
{
"type": "frontmost_application_if",
{
"categories": [
{
"title": "## 🚀 Features",
"labels": [
"feature",
"feat"
]
},
{
@ipcjs
ipcjs / deps_hook.gradle
Created April 12, 2022 15:12
尝试移除插件的原生代码=>不行,Flutter注册插件的时候会报错(
/**
* Hook <a href="https://github.com/flutter/flutter/blob/c8538873c80e34231d7a93f9ca1e5ec22c8804b1/packages/flutter_tools/gradle/flutter.gradle#L385">这个方法调用</a>
* 将`compileOnlyProjects`中指定的依赖改成通过`compileOnly`来依赖, 达到让插件类不被编译的目的!
* */
class ProjectMetaClass extends DelegatingMetaClass {
ProjectMetaClass(MetaClass metaClass) { super(metaClass) }
Object invokeMethod(Object object, String name, Object[] args) {
if (name == 'dependencies' && args.length == 1 && args[0] instanceof Closure) {
// println("project=>$name: $args")
@ipcjs
ipcjs / pac_test.js
Created December 31, 2021 15:28
test pac.txt by node.js
const fs = require('fs')
const pacText = fs.readFileSync('./pac.txt', { encoding: 'utf8' })
const findProxyForURL = (() => {
const __PROXY__ = 'http://127.0.0.1:1080'
function isInNet(host, ip, mast) {
if (host === '127.0.0.1') {
return true
}
return false
@ipcjs
ipcjs / api_result.dart
Created June 15, 2021 02:40
Dio: ApiResultInterceptor
class ApiResult<T> {
final int code;
final T data;
final String? message;
const ApiResult({
required this.code,
required this.data,
this.message,
});
@ipcjs
ipcjs / UnitTool.java
Created March 5, 2021 08:53
g2kg/g2lb
class UnitTool {
/*
* g to kg
*/
public static float g2kg(float g, int divisionValueCode) {
float kg = g / 1000.f;
float v = gunit_general(kg, divisionValueCode);
return v;
}
@ipcjs
ipcjs / simple_date_format.dart
Last active February 19, 2021 10:01
SimpleDateFormat is used to format/parse simple patterns.
import 'package:intl/intl.dart';
/// @see:
/// - [intl/#83](https://github.com/dart-lang/intl/issues/83)
/// - [intl/#112](https://github.com/dart-lang/intl/issues/112)
/// - [DateFormat]
/// Created by ipcjs on 2021/2/19.
class SimpleDateFormat {
SimpleDateFormat(this.pattern) : assert(pattern.isNotEmpty);
final String pattern;
@ipcjs
ipcjs / route-by-tx.sh
Created December 16, 2020 14:01
使用腾讯加速器模式一加速代理服务器 : )
#!/bin/bash
# you proxy server ip
ip="172.105.237.77"
function setup_route() {
# obtain gateway
gateway=""
while [ "$gateway" = "" ]; do
sleep 2s