Skip to content

Instantly share code, notes, and snippets.

View Tsuki's full-sized avatar
🏢
Working from Hong Kong

Tsuki Tsuki

🏢
Working from Hong Kong
View GitHub Profile
package main
import (
"fmt"
"sort"
)
type Card struct {
Rank int
Hands []int
@Tsuki
Tsuki / WORKSPACE
Created July 19, 2019 02:35
golang workspace
workspace(name = "")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_bazel_rules_go",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/0.19.0/rules_go-0.19.0.tar.gz",
],
@Tsuki
Tsuki / karabiner.json
Last active July 16, 2019 07:29
karabiner.json
{
"simple_modifications": [
{
"from": {
"pointing_button": "button4"
},
"to": {
"key_code": "open_bracket",
"modifiers": [
"left_command"
@Tsuki
Tsuki / bazel.sh
Created July 4, 2019 04:59
cmd for bazel
bazel query //... --output label_kind | sort | column -t
@Tsuki
Tsuki / sswl.txt
Created March 5, 2019 13:34
shadowsock white list dummy
fHwq

Keybase proof

I hereby claim:

  • I am tsuki on github.
  • I am tsukatsuki (https://keybase.io/tsukatsuki) on keybase.
  • I have a public key ASBQ1wcgzFx-JZaa-pN2LdQ1jBJOI6ZsGWGds-b_p_nUYAo

To claim this, I am signing this object:

@Tsuki
Tsuki / des.go
Created May 23, 2018 07:43 — forked from cuixin/des.go
des ecb mode in golang
package main
import (
"bytes"
"crypto/des"
"errors"
)
func PKCS5Padding(ciphertext []byte, blockSize int) []byte {
padding := blockSize - len(ciphertext)%blockSize
@Tsuki
Tsuki / pacaur_install.sh
Created March 28, 2017 03:18 — forked from tadly/pacaur_install.sh
A simple shell script to quickly / easily install "pacaur" on archlinux
#!/bin/sh
# If you are new to arch, I encourage you to at least read and understand what
# this script does befor blindley running it.
# That's why I didn't make a one-liner out of it so you have an easier time
# reading and understanding it :)
#
# This scripts purpose is purly to save you a few seconds on your new installation.
#
# Enjoy your time on an awesome system. Arch FTW!
@Tsuki
Tsuki / web-servers.md
Created March 23, 2017 04:33 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Tsuki
Tsuki / Something.java
Created August 19, 2016 09:46 — forked from tfnico/Something.java
Send http request using google-http-client
// Related to https://gist.github.com/tfnico/5926374
// and http://stackoverflow.com/questions/14464486/guava-input-output-suppliers-and-urlconnection
static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
public void sendMessage(String url, String params){
final HttpURLConnection connection;
try {
HttpRequestFactory requestFactory = HTTP_TRANSPORT.createRequestFactory();