Skip to content

Instantly share code, notes, and snippets.

View RealYukiSan's full-sized avatar
👀
Observing the pattern

Yuki San RealYukiSan

👀
Observing the pattern
View GitHub Profile
@RealYukiSan
RealYukiSan / maxBinary.go
Created May 27, 2023 06:01
Get max decimal of binary in golang
package main
import (
"fmt"
"math"
)
func main() {
binaryLength := 8
var maxValueInDecimal float64 = 0
@RealYukiSan
RealYukiSan / hello.c
Created August 19, 2023 02:56
Hello World in C
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
@RealYukiSan
RealYukiSan / ringkasan.md
Last active September 27, 2023 10:24
UI UX Summarize

Pardon me for the paper that isn't well formed. Please feel free to add additional information.

default setup UI UX design system guideline:

  • typography | max 2 font style (common base style combination are serif (for the content) and sans-serif (for the heading/title)
  • color scheme & color theory like gradient | max ?
  • icon | max 1 style icon, pick your best!
  • consistent components property like:
    • rounded in the shape like card
    • size of headline, content, and etc...
@RealYukiSan
RealYukiSan / processor_arch.md
Last active November 3, 2023 14:16
A brief summary of processor architecture and operating system design

List of processor architecture

Here's the list of processor architecture, Classified by ISA and architectural complexity

  • CISC
    • x86 and x86-64 or AMD64 are the same instruction sets, the only difference is "64-bit extension"
  • RISC
    • ARM
    • RISC-V
  • MIPS
@RealYukiSan
RealYukiSan / print_piped.c
Last active November 29, 2023 03:04
Iseng on t.me/c/1987506309/609/1516
#include <stdio.h>
int main(void) {
char buf[10];
fread(buf, 1, 10, stdin);
fwrite(buf, 1, 10, stdout);
return 0;
}
@RealYukiSan
RealYukiSan / diff.sh
Created March 22, 2024 02:58
Script for diff the paragraph
#!/bin/bash
# used for checking grammar, it uses Internal Field Separator
# related link: https://stackoverflow.com/questions/454427/string-difference-in-bash
# todo: figuring out a better algorithm than checking word by word in a linear fashion
# Function to compare two words
compare_words() {
local word1="$1"
local word2="$2"
if [[ "$word1" != "$word2" ]]; then
@RealYukiSan
RealYukiSan / redsocks.rules
Created March 23, 2024 13:04
iptables rules for redsocks
# Transparent SOCKS proxy
# See: http://darkk.net.ru/redsocks/
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:REDSOCKS - [0:0]
@RealYukiSan
RealYukiSan / revision.md
Last active March 29, 2024 06:33
Git and SSH

Better format

Authenticate #git through #ssh

Generate asymmetric key using the command below:

cd ~/.ssh
ssh-keygen -t rsa
@RealYukiSan
RealYukiSan / client.js
Created March 29, 2024 15:19
Tried simple websocket communication
const socket = new WebSocket("ws://localhost:8080")
socket.onopen = function (e) {
alert('[open] connection established')
alert('sending data to server')
socket.send('My name is who am i?');
}
socket.onmessage = function (ev) {
alert(`[message] data received from srv: ${ev.data}`);
@RealYukiSan
RealYukiSan / time.sh
Last active April 10, 2024 02:21
Useful command to remind you about time
#!/usr/bin/sh
watch -n 0.1 "date +\"%d-%m-%Y %H:%M:%S.%9N\""