Skip to content

Instantly share code, notes, and snippets.

View RigoLigoRLC's full-sized avatar
😉
Working on something big

Wu Haotian RigoLigoRLC

😉
Working on something big
View GitHub Profile
@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",
#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 / 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);
Update note: Linux kernel commit feb627e8d6f69c9a319fe279710959efb3eba873
breaks this patch and will need to be reverted in order for this to work on
kernels starting with 5.16.
From 28e67537895c4b46b9721f19609ee4f2ccb8c132 Mon Sep 17 00:00:00 2001
From: pi <secret@hidden.mail>
Date: Sat, 7 Nov 2020 18:41:42 +0100
Subject: [PATCH] Add 'hide-hypervisor' QMP command
CAUTION: Extremely hacky stuff below. Use at own risk of bugs, breakage and
@RigoLigoRLC
RigoLigoRLC / jlu_cas.kt
Created October 16, 2023 03:36
JLU CAS Login snippet (Does Not Work)
// Build an client that doesn't follow redirect
val okhttpNoRedirect = okhttp.newBuilder()
.followRedirects(false)
.build()
if (!verifyUserCredentials()) {
state._loginState.value = LoginState.NoSessionData
return
}
state._loginState.value = LoginState.LoggingIn
@RigoLigoRLC
RigoLigoRLC / pd.py
Created January 12, 2024 16:30
CAN_H Decode for libsigrokdecode for DSView(v1.3.1) for DSLogic
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de>
## Copyright (C) 2019 Stephan Thiele <stephan.thiele@mailbox.org>
## Copyright (C) 2023 DreamSourceLab <support@dreamsourcelab.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
@RigoLigoRLC
RigoLigoRLC / svr1_lua.hexpat
Created January 27, 2024 03:49
Synthesizer V R1 - Lua Bytecode Hexpat
struct header {
u8 initial, format, version;
u8 literal[6];
u32 intdata;
float floatdata;
u8 lintsize, insnsize, numbersize, intsize,
ptrsize;
};
struct undump {
@RigoLigoRLC
RigoLigoRLC / template.svg
Created April 13, 2024 07:33
红色电音极地大冲击模板 (CC BY-NC 4.0)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RigoLigoRLC
RigoLigoRLC / FutureComposer1.4.hexpat
Created April 24, 2024 04:21
Future Composer 1.4 module file format description
#include <std/core.pat>
struct fc_pattern_index_entry_channel {
u8 pattern_id;
u8 transpose;
u8 sound_transpose;
};
struct fc_pattern_index_entry {