Skip to content

Instantly share code, notes, and snippets.

View ytxmobile98's full-sized avatar

Tianxing Yang ytxmobile98

  • Guangzhou, China
  • 12:21 (UTC +08:00)
View GitHub Profile
@ytxmobile98
ytxmobile98 / 2014-material-colors.txt
Created June 2, 2022 01:29
2014 material design colors
Red
50 #FFEBEE
100 #FFCDD2
200 #EF9A9A
300 #E57373
400 #EF5350
500 #F44336
600 #E53935
700 #D32F2F
800 #C62828
@ytxmobile98
ytxmobile98 / vscode-install.sh
Last active October 23, 2023 06:29
VSCode install
#!/usr/bin/env bash
# Reference: https://code.visualstudio.com/docs/setup/linux
sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
sudo apt install apt-transport-https
@ytxmobile98
ytxmobile98 / mmap_demo_main.c
Last active November 15, 2021 19:13
Shared memory demo using mmap
// Note: to compile, you must link with -lrt.
// cc mmap_demo_main.c -o main.out -lrt
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/wait.h>
@ytxmobile98
ytxmobile98 / timer_main.cpp
Last active October 16, 2021 21:23
C++ timer example
#include <iostream>
#include <set>
extern "C" {
#include "unistd.h"
#include <sys/timerfd.h>
}
int main() {
std::set<int> timerFds;
@ytxmobile98
ytxmobile98 / A.cpp
Created September 5, 2021 01:15
PIMPL example
#include <iostream>
#include "A.h"
void A::inc() {
++impl->i;
}
void A::dec() {
--impl->i;
@ytxmobile98
ytxmobile98 / data.txt
Created August 10, 2021 19:36
Node.js fs send static text file with piping example
https://news.cctv.com/2021/08/09/ARTIu3JIKV66MVsSghjxZi4l210809.shtml?spm=C96370.PPDB2vhvSivD.E0O8qNryTckW.3
  央视网消息(新闻联播):我们正在经历的2021年,是中国共产党成立100周年,是“十四五”开局之年。今年以来,以习近平同志为核心的党中央领航掌舵,统筹中华民族伟大复兴战略全局和世界百年未有之大变局,引领中国踏上伟大复兴新的“赶考”路,不断满足人民对美好生活新期待,加快构建新发展格局,为构建人类命运共同体作出新贡献,推动党和国家事业迈上新台阶。从今天(8月9日)起,《新闻联播》推出系列报道《领航新时代 开启新征程——习近平总书记今年以来治国理政纪实》。今天播出第一集《百年奋斗砺初心 迈向伟大复兴新的赶考路》。
  2021年的中国,站在“两个一百年”的历史交汇点上,过去的百年奋斗风云激荡,书写了中华民族历史上最恢宏的史诗。第二个百年征程绝非坦途,需要中国共产党人赓续红色血脉,把握新的历史方位,交出新的时代答卷。今年以来,面对错综复杂的国际局势,以习近平同志为核心的党中央观大势、谋大局、抓大事,引领中国巨轮劈波斩浪、扬帆远航。
  7月1日上午,庆祝中国共产党成立100周年大会在北京天安门广场隆重举行,这是党的盛典、人民的节日。习近平总书记“七一”重要讲话,成为激励全党全国各族人民向第二个百年奋斗目标进军的政治宣言和行动纲领。
  习近平总书记说:“我们要用历史映照现实、远观未来,从中国共产党的百年奋斗中看清楚过去我们为什么能够成功、弄明白未来我们怎样才能继续成功,从而在新的征程上更加坚定、更加自觉地牢记初心使命,开创美好未来。”
@ytxmobile98
ytxmobile98 / Chinese.cpp
Created July 29, 2020 00:00
Chinese output in C++
#include <iostream>
#include <cstring>
int main() {
setlocale(LC_ALL, "zh_CN.UTF-8");
const wchar_t test[] = L"abc我惊呆了123";
for (const auto& i: test) {
std::wcout << i << std::endl;
}
@ytxmobile98
ytxmobile98 / KMS_office.cmd
Created July 10, 2020 18:44 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
@echo off
title Microsoft Office 2019 versions are supported!&cls&echo
============================================================================&echo
#Project: Activating Microsoft software products for FREE without software&echo
============================================================================&echo.&echo
#Supported products:&echo - Microsoft Office Standard 2019&echo - Microsoft Office Professional Plus 2019&echo.&echo.&(if exist
"%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist
"%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b
..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b
..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo
@ytxmobile98
ytxmobile98 / README.md
Last active June 3, 2026 01:03
Windows 11 Pro Activation

Windows 11 Pro 激活步骤

请务必以管理员身份打开命令提示符,并运行以下代码。

slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
slmgr /skms kms.luody.info
slmgr /ato
@ytxmobile98
ytxmobile98 / GZMTR.gpl
Created May 17, 2020 00:27
Guangzhou-Metro-line-colors
GIMP Palette
Name: GZMTR Line Colors
# by ytx21cn
# The colors of lines under planning or construction are subject to change. Please refer to the newest official GZMTR system map.
0 0 0 Black
255 255 255 White
153 153 153 Gray (40%)
204 204 204 Gray (20%)
255 0 0 Red