Skip to content

Instantly share code, notes, and snippets.

View JavaCS3's full-sized avatar
😑
Working

Charles Wei JavaCS3

😑
Working
View GitHub Profile
@JavaCS3
JavaCS3 / color256.sh
Created August 5, 2019 13:44
color256.sh
for fgbg in 38 48 ; do #Foreground/Background
for color in {0..256} ; do #Colors
#Display the color
echo -en "\e[${fgbg};5;${color}m ${color}\t\e[0m"
#Display 10 colors per lines
if [ $((($color + 1) % 10)) == 0 ] ; then
echo #New line
fi
done
echo #New line
const assert = require('assert')
const ENCODERS = {
raw(len) {
return function(v) {
assert(v instanceof Buffer)
const buffer = Buffer.alloc(len)
v.copy(buffer)
return buffer
@JavaCS3
JavaCS3 / main.c
Created March 27, 2020 09:38
UUID String to C Array
#include <stdio.h>
#include <stdlib.h>
#define CHAR2INT(x) (('0' <= x && x <= '9') ? \
(x - '0') : \
(('a' <= x && x <= 'f') ? \
(10 + (x - 'a')) : \
(('A' <= x && x <= 'F') ? (10 + (x - 'A')) : (0))))
#define UUID2ARRAY(uuid) { \
@JavaCS3
JavaCS3 / README.md
Last active June 28, 2023 01:40
正则表达式学习

正则表达式学习

正则表达式是一个可以帮助我们匹配复杂字符串模式的工具

匹配字符(What)

  • .
  • [abcd] [a-zA-Z] [^abcd]
  • \d \s \t \w ...

匹配数量(How)

@JavaCS3
JavaCS3 / README.md
Last active November 1, 2020 11:14
2019 Personal Highlights

2019 Personal Highlights

Jan.

  1. 去美国北卡出差,第一次和美国人打德州扑克,去了Duke大学

Jun.

  1. 参加大学同学婚礼,当了第二次伴郎

Jul.

  1. 放弃公租房