Skip to content

Instantly share code, notes, and snippets.

View OrcaXS's full-sized avatar

OrcaXS

  • Shenzhen, China
View GitHub Profile
@OrcaXS
OrcaXS / MCPaster-workflow.applescript
Last active August 29, 2015 14:13
Applescript for Alfred Workflow MCPaster
tell application "Alfred 2" to run trigger "MCPaster" in workflow "com.orcaxs.mcpaster2" with argument ""
@OrcaXS
OrcaXS / Yosemite_MCPaster.md
Last active August 29, 2015 14:13
Using MCPaster in Yosemite

#For OS X Yosemite: 使用 Karabiner, Alfred Workflow 和 AppleScript 在 Minecraft 中输入中文

⚠如果你在使用 Mavericks 或以下的版本,请使用**这个方法**
⚠需要 [Alfred Powerpack(收费,£17)] (http://www.alfredapp.com/powerpack/) [Karabiner(免费)] (https://pqrs.org/osx/karabiner/)

由于在 Yosemite 中 osascript 弹出的输入框无法切换输入法,所以在 Mavericks 中可用的原方法失效。以下方法的思路是通过在 Alfred 中输入中文,用 Workflow 执行切换 Minecraft 并粘贴的 AppleScript。

  1. 安装 Alfred v2Karabiner
  2. Minecraft Paster.alfredworkflowMCPaster-workflow.applescript 下载到本地。安装 Minecraft Paster.alfredworkflow 至 Alfred。
  3. 参照这篇 Gist设置好 Karabiner 中 AppleScript 和快捷键的触发方式,但确保 AppleScript 路径指向上一步下载的 MCPaster-workflow.applescript。
@OrcaXS
OrcaXS / ddns-start.sh
Created July 27, 2016 09:11
Google Dynamic DNS update script for Tomato firmware
#!/bin/sh
set -u
#set -x
U=username
P=password
H=hostname
IP="$(ip -o addr show ppp0 | awk '/inet / {print $4}')"
DIGIP="$(dig +short $H)"
@OrcaXS
OrcaXS / video2gif.fish
Last active September 23, 2017 07:11
Convert video to gif using ffmpeg, written in fish
# Inspired from http://superuser.com/a/556031
function videotrim --description 'Trim video (filename) (fromtime) (totime) (scalepx) (outputname)' --argument filename fromtime totime scalepx outputname
if not test -f "$filename"
echo "File not exists."
return 1
else if not test -r "$filename"
echo "File is not readable."
return 1
end
if not test -n "$fromtime"

animeloop-cli

Anime loop video command line tool.

Install via Arch Linux User Repository (aur)

with yaourt

yaourt -S animeloop-cli

Keybase proof

I hereby claim:

  • I am orcaxs on github.
  • I am orcaxs (https://keybase.io/orcaxs) on keybase.
  • I have a public key whose fingerprint is 4229 6AA4 615A FDE7 AC9E D48F F5E4 C83D 1A38 4AB4

To claim this, I am signing this object:

@OrcaXS
OrcaXS / karabiner-elements-shift-to-caps-lock-under-chinese-scim.json
Last active June 6, 2018 02:55
karabiner-elements-shift-to-caps-lock-under-chinese-scim
{
"description":"Press Shift to toggle CN/EN",
"manipulators":[
{
"conditions":[
{
"input_sources":[
{
"input_source_id":"com.apple.inputmethod.SCIM.ITABC"
}
@OrcaXS
OrcaXS / keymap.c
Created June 6, 2018 09:53
tada68 custom keymap
#include "tada68.h"
// Used for SHIFT_ESC
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
@OrcaXS
OrcaXS / shadowiptables.sh
Last active February 18, 2020 16:13 — forked from qwIvan/shadowiptables.sh
ss-redir + iptables + china_ip_list
#!/bin/sh
# china_ip_list.txt from https://github.com/17mon/china_ip_list
set -x
chnroute_file=./china_ip_list/china_ip_list.txt
src_addr=192.168.100.1/24
gamesrc_addr=192.168.200.1/24
game_port=1082
local_port=1081
clash_dns_port=1053
@OrcaXS
OrcaXS / cacerts.txt
Last active August 5, 2018 08:35
Updated cacerts for NaCL SDK
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# The following SSL certificates are used to validate the SSL connection
# to https://storage.googleapis.com
GLOBAL_SIGN_CA_CERTIFICATE
-----BEGIN CERTIFICATE-----