Skip to content

Instantly share code, notes, and snippets.

View RigoLigoRLC's full-sized avatar
😉
I work on stuff never been done before

Wu Haotian RigoLigoRLC

😉
I work on stuff never been done before
View GitHub Profile
@RigoLigoRLC
RigoLigoRLC / chkwntrm.c
Created November 26, 2021 15:06
Check if a CLI program is running inside Windows Terminal
#include <psapi.h>
#include <windows.h>
#ifdef _WIN32
int checkIsWinTerm()
{
HWND hConsoleWnd = GetConsoleWindow();
DWORD dwConsolePid;
GetWindowThreadProcessId(hConsoleWnd, &dwConsolePid);
#include <windows.h>
#include <iostream>
int main()
{
CONSOLE_SCREEN_BUFFER_INFO info;
HANDLE hdl = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hdl, &info);
WORD wBackgroundColor = info.wAttributes & (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
@RigoLigoRLC
RigoLigoRLC / A-EasyEDA-Scripting-API-Test.js
Last active July 9, 2020 04:52
EasyEDA 6.4.0 scripting log
//Test code with footprint, cause the coordinates of {4000,3000} is used
//to give a proper position on footprint editor.
//Create text.
api('createShape', {"shapeType": "TEXT",jsonCache:{text:"HELLO", height:50, layerid:1, "line-width":12, x: 4200, y:3000}});
//Create pad. Very practical. tested on footprint.
api('createShape', {"shapeType": "PAD", jsonCache:{
number:1,
shape:"ELLIPSE",