Skip to content

Instantly share code, notes, and snippets.

View quonic's full-sized avatar

Spyingwind quonic

  • Dallas
View GitHub Profile
@leegrey
leegrey / TileMapPathField.ts
Last active May 4, 2020 12:52
Pathfinding on a Grid with Flow Fields
// Copyright Lee Grey, 2014
// License: MIT
module lg.tileSystem {
import Vector2D = lg.math.geometry.Vector2D;
export class FieldInfo {
distanceFromTarget: number = -1;
@IISResetMe
IISResetMe / Get-MachineSID.ps1
Created December 30, 2014 15:40
PsGetSid local machine SID implementation in PowerShell
function Get-MachineSID
{
param(
[switch]
$DomainSID
)
# Retrieve the Win32_ComputerSystem class and determine if machine is a Domain Controller
$WmiComputerSystem = Get-WmiObject -Class Win32_ComputerSystem
$IsDomainController = $WmiComputerSystem.DomainRole -ge 4
@powerman
powerman / AsciidocCheatsheet.adoc
Last active July 4, 2024 12:42
Asciidoc cheatsheet for GitHub

Asciidoc cheatsheet for GitHub

@gbaman
gbaman / HowToOTG.md
Last active July 19, 2024 11:47
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@xem
xem / readme.md
Last active July 14, 2024 10:15
Maths & trigonometry cheat sheet for 2D & 3D games

Conventions

  • A = [xA, yA] is a point on the 2D plane. Same for B, C, ...
  • lengths are in any unit (ex: pixels)
  • code snippets are in JavaScript

Degrees to radians

angleRad = angleDeg * Math.PI / 180;

@RandomInsano
RandomInsano / fuzzer.py
Created September 24, 2016 18:14
Serial fuzzer written in Python3
#!/usr/bin/env python3
import serial
import binascii
#open serial
ser = serial.Serial(
port='/dev/tty.usbserial-A6005kdh',
baudrate=115200,
timeout=0.005
@arrieta
arrieta / lexer.cpp
Last active July 19, 2024 21:02
Simple C++ Lexer
// A simple Lexer meant to demonstrate a few theoretical concepts. It can
// support several parser concepts and is very fast (though speed is not its
// design goal).
//
// J. Arrieta, Nabla Zero Labs
//
// This code is released under the MIT License.
//
// Copyright 2018 Nabla Zero Labs
//
@agatsoh
agatsoh / python3.7.3_on_MX_Linux_18_1.md
Last active September 8, 2020 05:52
Install python 3.7 on MX Linux 18.1

Installing Python 3.7.3 on MX-linux 18.1

I was following this blog to install python 3.7.3 on my MX-linux 18.1 machine. Step by step procedure is as follows

  1. Install the pre-requisites

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
 libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev
@JarekParal
JarekParal / README.md
Created December 9, 2019 15:57
Pyinstaller - update version during CI build / automatic update of version file
python CI/updateVersion.py %NEW_VERSION%
pyinstaller testApp.py --version-file "CI/version.py"
@mdouchement
mdouchement / steam-link.md
Last active December 29, 2023 08:49
Steam Link SSH & how to disable Bluetooth