This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
cd $HOME/.vscode-server | |
for f in $(ls -1 --sort=time .*.token | tail -n +2); do | |
id=${f:1:40} | |
if [[ -z "$id" ]]; then | |
echo "invalid file $f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"os" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// rustc -O bootstrap.rs | |
use std::env; | |
use std::process::Command; | |
#[cfg(target_os = "windows")] | |
fn terminal() -> Command { | |
Command::new("msys2.exe") | |
.env("CHERE_INVOKING", "1") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "textflag.h" | |
// func searchTag(m *Message, tag int) int | |
TEXT ·searchTag(SB), NOSPLIT, $0-24 | |
MOVQ m+0(FP), BX | |
MOVQ tag+8(FP), R9 | |
MOVQ 16(BX), DI | |
MOVQ 24(BX), CX | |
MOVQ 40(BX), SI | |
XORQ DX, DX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package treap | |
type node struct { | |
key int | |
prior int | |
left *node | |
right *node | |
} | |
func zig(p *node) *node { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
gcc -std=c99 -O3 -Wall -Werror \ | |
-DUNICODE \ | |
-o $@ $^ \ | |
-lkernel32 -luser32 \ | |
-Wl,--subsystem,windows,--gc-sections,--strip-all | |
*/ | |
#include <windows.h> | |
#define WM_USER_SWITCH_IME (WM_USER + 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/md5" | |
"crypto/sha1" | |
"crypto/sha256" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io/ioutil" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package xxtea | |
import ( | |
"unsafe" | |
) | |
const _DELTA = 0x9e3779b9 | |
func EncryptBytes(m []byte, k *[4]uint32) { | |
if len(m) < 8 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -z `lsmod | grep bbr` ]; then | |
modprobe tcp_bbr | |
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf | |
fi | |
if [ -z `sysctl net.ipv4.tcp_congestion_control | grep bbr` ]; then | |
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf | |
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf | |
sysctl -p | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
hook= | |
if [ "$1" == "-c" ]; then | |
hook=$2 | |
shift 2 | |
fi |
NewerOlder