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。

animeloop-cli

Anime loop video command line tool.

Install via Arch Linux User Repository (aur)

with yaourt

yaourt -S animeloop-cli
@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"

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 / 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-----
@OrcaXS
OrcaXS / download.py
Created August 5, 2018 09:04
Update download.py to remove ssl cert
# 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.
import hashlib
import os
import sys
# when pylint runs the third_party module is the one from depot_tools
# pylint: disable=E0611
from third_party import fancy_urllib
@OrcaXS
OrcaXS / wireguard.sh
Created August 11, 2018 14:15 — forked from merrickluo/wireguard.sh
wireguard.sh
#!/bin/bash
set -e
[[ $UID != 0 ]] && exec sudo -E "$(readlink -f "$0")" "$@"
up() {
# setup wg0
ip link add dev wg0 type wireguard
ip addr add dev wg0 10.0.200.13/32
wg setconf wg0 /etc/wireguard/wg0.conf