Skip to content

Instantly share code, notes, and snippets.

View ONLYA's full-sized avatar
🔨
Parallel working on two projects

Xiaosheng An ONLYA

🔨
Parallel working on two projects
View GitHub Profile
@ONLYA
ONLYA / interesting_useless_functions.py
Created May 23, 2024 14:43
Interesting useless functions
ub_get_the_mug = lambda n:"Get the " + "get the " * n + "mug " * n + "mug"
@ONLYA
ONLYA / README.md
Created April 19, 2024 10:29 — forked from Gadgetoid/README.md
Raspberry Pi 5 - All channels on pwm0
@ONLYA
ONLYA / install.sh
Created October 4, 2023 21:19 — forked from ikr4-m/install.sh
Hyper-V Enhanced Session for Debian
#!/bin/sh
# This script based on linux-vm-tools for Ubuntu 22.02.
# Thanks to https://github.com/Hinara/linux-vm-tools/ to script
# This script is for Ubuntu 22.04 Jammy Jellyfish to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
#
@ONLYA
ONLYA / string_split.c
Created June 14, 2023 19:14
Safely split string into the array of strings by a group of delimiters
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
char ** token_split (char * in_str, const char * delim, int * token_count);
/*
* alloc_str function allocates memory and copy substring
@ONLYA
ONLYA / pip-install-without-subprocess.py
Created February 7, 2023 16:09
How to install pip packages without the need to invoke shell or subprocess
#!/bin/bash
# You need to install "certifi" pip package at first
import certifi
import pip
# packages to be installed
packages = ["pandas","matplotlib"]
cmd = ["install", "-U", "--cert", certifi.where()] + packages
@ONLYA
ONLYA / KiCAD_CopperSpiral_v2.py
Created February 19, 2022 19:20 — forked from JoanTheSpark/KiCAD_CopperSpiral_v2.py
v2 with spin direction and increasing amount of segments per turn for smoother result in outer circles
import sys, os
import shutil
import math
import itertools
from copy import deepcopy
# 0 1 2 3 4 5 6
LIST_elmt = [" ("," (start ",") (end ",") "," (layer ",") ","))"]
#LIST_elmt = [" (gr_line (start 131.571908 182.314571) (end 112.874456 120.68499) (angle 90) (layer Dwgs.User) (width 0.1))"]
#LIST_elmt = [" (segment (start 118.7 106.7) (end 119.4 106.7) (width 0.25) (layer B.Cu) (net 0))"]