Skip to content

Instantly share code, notes, and snippets.

View OrcaXS's full-sized avatar

OrcaXS

  • Shenzhen, China
View GitHub Profile
@OrcaXS
OrcaXS / curve.html
Last active August 14, 2018 00:49 — forked from uucky/curve.html
Curve Calc
<!DOCTYPE html>
<html>
<head>
<title>Curve</title>
<script defer>
//弧长c 拱高h - 半径r 弦长l
// 圆心角a
function calcR1(h, l) {
const r = ( Math.pow(h,2) + Math.pow((l/2),2) )/ 2/h;
const a = 2 * Math.asin( l / 2 / h );
@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
@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 / 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 / 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 / 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 / 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"
}

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:

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"