Skip to content

Instantly share code, notes, and snippets.

@yaqinking
yaqinking / DeleteRarZipFileDeleteFile.sh
Last active October 11, 2015 14:51
Delete current folder all rar files, then zip all files under every folder, finally delete all ziped files under every folder
rm -rf *.rar;for i in */; do zip -r "${i%/}.zip" "$i";done;for i in */; do rm -rf "${i%/}";done
@yaqinking
yaqinking / better-bangumi-style.css
Created February 6, 2016 07:41
让 Bangumi 点格子的体验更好一点
/*
适用于 bgm.tv bangumi.tv chii.in RC3 版本。
我是使用的 Stylebot for Chrome 来改变 CSS 的。
效果图: http://i.imgur.com/JmI1DmI.jpg
功能:
1. 反向条目显示方式。(每天看完新番打开之后,一般情况下第一列就是自己需要点的。虽然补旧番的时候会到最下面 <_< )
2. 一列显示 3 个条目。(比 2 列要来的实在吧 >_< )
@yaqinking
yaqinking / RestartBluetooth.scpt
Created February 14, 2016 08:27
重启 Mac 蓝牙来解决 iOS 端 AirDrop 不能发现 Mac 设备
-- 有时候 Mac 的 AirDrop 会在 iOS 端发现不了,当窝发觉这个 bug 可以通过重启 Mac 蓝牙解决的时候,Google 加折腾找到了这个脚本的前半部分,经过修改,直接生成重启蓝牙的大法,解决问题,可喜可贺,可喜可贺(圆润的滚走
-- 如果还是在 iOS 端发现不了,那就关闭 iOS 端的 AirDrop 然后再开启,所谓的重启 iOS 端 AirDrop 大法诞生。
-- 至于 AirDrop 的用途,当然是拿来发 DL 链接 <_<
-- 脚本参考地址:https://apple.stackexchange.com/questions/152333/toggle-bluetooth-applescript-not-working-in-yosemite
property thePane : "com.apple.preferences.bluetooth"
tell application "System Preferences"
activate
set the current pane to pane id thePane
@yaqinking
yaqinking / css-dmhy.css
Created October 15, 2016 05:33
Better Experience for windows hdpi devices for share.dmhy.org
/*
Author: yaqinking
URL Pattern: share.dmhy.org/*
Use Stylebot to customize website css for a better personal ui experience.
Web's UI is open for everyone.
*/
tr {
height: 75px;
font-size: 16px;
}
@yaqinking
yaqinking / snippets.cson
Created October 26, 2016 08:30
KAGEX/KAG/TJS auto complete snippets in Atom
# THIS SNIPPETS IS CREATED BY @yaqinking IN Atom 1.11.2 FELL FREE TO MODIFY IT
# KAGEX script auto complete
'.source.kagex':
# Common command expand
'Position layer':
'prefix': 'position'
'body': '[position layer=$1 width=$2 height=$3]\n$4'
'Trans method time canskip':
'prefix': 'trans'
'body': '@trans method=$1 time=$2 canskip=false'
@yaqinking
yaqinking / kag.sublime-completions
Created November 20, 2016 04:02
KAG auto completion for Sublime Text 3
{
"scope": "source.ks",
"completions":
[
{ "trigger": "sf \t 系统变量", "contents": "sf." },
{ "trigger": "f \t 游戏变量", "contents": "f." },
{ "trigger": "tf \t 临时变量", "contents": "tf." },
{ "trigger": "tf \t 临时变量", "contents": "tf." },
{ "trigger": "lr \t 点击换行", "contents": "[lr]" },
@yaqinking
yaqinking / kag_calculate_macro_parameter_value.ks
Created November 21, 2016 04:42
KAG/TJS script example 计算传入 macro 的变量值时
[iscript]
/**
* 计算传入 macro 的变量值时
*/
var result = 0;
var xpos = 0;
var xmov = 0;
[endscript]
@macro name=calc_move
@yaqinking
yaqinking / startup.tjs
Last active November 21, 2016 04:47 — forked from jin1016/startup.tjs
吉里吉里Z 播放 H.264/AVC 编码的 mp4 文件
/**
* 主要用来发布时减小视频的文件大小。(同时这样子就算是放 1080p/4k 的视频时,资源大小也说的过去,既然 krkrz 使用 d3d9 支持分辨率到 8k,那应该不是大问题的 poi,大概。)
*/
class H264Window extends Window {
var base;
var video;
function H264Window( width, height ) {
super.Window();
setSize( width, height );
setInnerSize( width, height );
@yaqinking
yaqinking / convert-utf8-utf16le.bat
Created November 24, 2016 09:12
使用 iconv 来转换 UTF-8 编码到 UTF-16LE 编码
:: 一句一句执行
mkdir new
for /f %x in ('dir /b *.tjs') do iconv -f UTF-8 -t UTF-16LE %x > new\%x
{
"scope":"source.tjs",
"author": "yaqinking",
"completions":
[
{ "-------": "-------------DECLARE START----------- " },
{ "trigger": "func \t Declare function", "contents": "function $1($2) {\n $3\n}" },
{ "trigger": "func \t Declare function call super.$1(...)", "contents": "function $1($2) {\n $3\n super.$1(...);\n}" },
{ "trigger": "classExtendsWindow \t Declare Window subclass", "contents": "class $1 extends Window {\n function $1() {\n super.Window();\n $3\n }\n\n function finalize() {\n super.finalize();\n }\n}" },
{ "trigger": "classExtendsLayer \t Declare Layer subclass", "contents": "class $1 extends Layer {\n function $1(window, parent) {\n super.Layer(window, parent);\n $3\n }\n\n function finalize() {\n super.finalize();\n }\n}" },