Skip to content

Instantly share code, notes, and snippets.

View norinorin's full-sized avatar

norinorin

  • Indonesia
  • 05:19 (UTC +07:00)
View GitHub Profile
@jramseygreen
jramseygreen / crypt.py
Last active May 15, 2022 16:34
websocket connection python <--> javascript with RSA encrypted tunnel
import base64
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
# pass in the public key of the client to communicate with
class Crypt:
def __init__(self):
# 1024 means the keysize will be 1024 bits
@jhonnymichel
jhonnymichel / gamedev-trigonometry.md
Last active September 20, 2023 16:57
Basic trigonometry for game development

Introduction

two distinct points (for example, a game object position and the mouse cursor position) in an area can always be two corners of a Right Triangle (Triângulo-retângulo in ptbr). A triangle has three sides: The Hypotenuse, the Adjacent and the Opposite.

The distance between two points in the X axis corresponds to the Adjacent side of a triangle, The distance between two points in the Y axis corresponds to the Opposite side of a triangle.

The Hypotenuse is the shortest distance between the two points.

This means we can use trigonometry to handle many interactions between objects when programming visual stuff.

@ghostbear
ghostbear / Spotify - How to reduce and limit the cache size (Windows - Mac).md
Last active July 4, 2024 13:36
[Spotify] How to limit the cache size (Windows/Mac OS)

Credit to MadHatter

WINDOWS

Use your text editor of choice or if you don't have one use Windows Notepad
Opening with Notepad may or may not result in a fancy mess

  1. Close Spotify
  2. Open File Explorer and paste the following into the address bar %appdata%/Spotify¤
  3. Open the file named prefs with your text editor
  4. Change the numeric value following storage.size= . If storage.size= doesn't exist add it manually to the end of the file and assign numeric value. This value represents megabytes. One gigabyte equals 1024 megabytes. In the end, it should look something like this storage.size=1024
  5. Save the file
@diffficult
diffficult / installing_virt_manager.md
Last active June 1, 2024 13:53
Easy instructions to get virt-manager qemuv/kvm running on Arch

Easy instructions to get QEMU/KVM and virt-manager up and running on Arch

  1. Make sure your cpu support kvm with below command:

     grep -E "(vmx|svm)" --color=always /proc/cpuinfo
    
  2. Make sure BIOS have enable “Virtualization Technology”.

  3. User access to /dev/kvm so add your account into kvm(78) group: