Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 Canvas Rectangles</title>
<style>
body {
margin: 0;
display: flex;
@Andersama
Andersama / keyword_dfa.h
Last active January 17, 2025 06:44
Generates a dfa designed to accept a list of keywords
#pragma once
#include <vector>
#include <array>
#include <string>
#include <string_view>
#include <cstdint>
#include <algorithm>
#include <format>
#include <iostream>
@mynamebvh
mynamebvh / index.js
Last active January 17, 2025 06:39
Generate QR Banking
const VietQR = require("./vietQR");
const vietQR = new VietQR();
vietQR
.setBeneficiaryOrganization("970423", "mynamebvh")
.setTransactionAmount("50000")
.setAdditionalDataFieldTemplate("test");
console.log(vietQR.build());
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas Game with Mouse Rotation</title>
<style>
body {
margin: 0;
display: flex;
@allenk
allenk / deepclean.cmd
Last active January 17, 2025 06:35
ASUS Software Clean Up Tool
@echo off
:: ------------------------------------------------------------------------------------------------------------
:: Clean Up ASUS All
:: ------------------------------------------------------------------------------------------------------------
:: The tool helps to clean up all ASUS software from system
:: ------------------------------------------------------------------------------------------------------------
:: Before running the tools,
:: 1. Complete backup your system.
:: 2. Disable ASUS Apps from BIOS (MyASUS and Armoury)
:: 3. Run ASUS remove tools (Armoury Crate Uninstall Tool.exe, or geek_uninstall.exe).

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@ellsies
ellsies / Crossover.sh
Last active January 17, 2025 06:31
Crackover (Complete free version of crossover)
#!/usr/bin/env bash
# checck if pidof exists
PIDOF="$(which pidof)"
# and if not - install it
(test "${PIDOF}" && test -f "${PIDOF}") || brew install pidof
# find app in default paths
CO_PWD=~/Applications/CrossOver.app/Contents/MacOS
test -d "${CO_PWD}" || CO_PWD=/Applications/CrossOver.app/Contents/MacOS
@xarinatan
xarinatan / networked pulseaudio.md
Last active January 17, 2025 06:30
How to set up PulseAudio over Network

How to set up PulseAudio over Network

PulseAudio actually has great networking capabilities. Especially when combined with Avahi/Zeroconf it is especially easy to set up, though technically it should also be possible without.

Setting up the server

  • Open /etc/pulseaudio/default.pa
  • At the end of the file, add load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.254.0/24 auth-anonymous=1 to activate networked audio from 192.168.254.0-255 without needing authentication.
  • Kill pulseaudio, it should be auto-restarted, or restart your login session to activate the changes. You should now be able to set PULSE_SERVER=192.168.254.XXX and have the remote audio working! If not check the firewall settings, PulseAudio seems to open a random port by default.

Setting up automatic configuration and discovery

  • On both the server and client, install pulseaudio-module-zeroconf and avahi, then after installing make sure Avahi always runs by running systemctl enable --now avahi-daemon

Best practices for PCB Design

Schematics

  • Power symbols should point upwards
  • Ground symbols should point downards
  • Sections should be labeled
  • Nets should generally not cross
  • Nets should be labeled
  • Either global or regular labels are fine