Skip to content

Instantly share code, notes, and snippets.

View VelocityRa's full-sized avatar

Nick Renieris VelocityRa

View GitHub Profile
@VelocityRa
VelocityRa / test_every_game.py
Last active August 18, 2016 14:28
For the Decaf emulator. It tests all games in a given directory and writes all logs in it
import subprocess
import os
import time
# For Python 2.7.x
# Configure the paths (by default, it works if you place it in a new folder in the decaf-emu directory)
# Logs are placed in that directory
# Warning: Will probably get pretty crazy with lots of games
@VelocityRa
VelocityRa / PrintLastXLines.py
Last active August 18, 2016 14:16
Prints last X lines of each .txt in given dir
import os
import time, datetime
from collections import deque
# Python 2.7.x
# Made for the decaf emulator
# Prints last X lines of each log in given directory (current by default)
last_x_lines = 20
log_lines_cutoff = 17 # number of chars to cut from each logfile (the date/time)
@VelocityRa
VelocityRa / classful_ip_connectability.c
Last active March 8, 2017 12:27
IP Verifier for Networks class
#include <stdio.h>
#include <stdbool.h>
#define MAX_IP_LEN 15 // Max length is 4*3 + 3, (max of 4 3-digit numbers, plus 3 periods)
typedef unsigned char BYTE;
// Enum for all possible IP classes
typedef enum {
A, B, C, D, E, LOOPBACK
// SpotifyAdMuter.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <string>
#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>
#include <stdlib.h>
glActiveTexture
glAttachShader
glBeginQuery
glBeginTransformFeedback
glBindBuffer
glBindBufferBase
glBindBufferRange
glBindFramebuffer
glBindProgramPipeline
glBindSampler
@VelocityRa
VelocityRa / WriteFile-Chunk-Benchmark.cpp
Created November 19, 2017 15:18
Windows WriteFile() benchmark on writing files in chunks
#include <benchmark/benchmark.h>
#include <string>
#include <sstream>
#include <windows.h>
#include <iostream>
constexpr static unsigned io_chunk_size = 1024 * 1024 * 8; // 8 MiB
static void BM_write_file_nochunks(benchmark::State& state) {
state.PauseTiming();
@VelocityRa
VelocityRa / collect_vita3k_logs.py
Last active August 18, 2018 22:19
Retrieves log files from given repositories' Issues for offline/batch processing/searching
"""
Retrieves log files from given ("REPO_NAMES") repositories
for offline/batch processing/searching.
Iterates thought all issues, finds the last posted comment
that contains at least one file and downloads all files to
appropriately named directories, with the filename being
the Issue title (game name/titleID).
Replaces invalid characters in that file name with '-' and
if there are multiple files in an issue, appends the
@VelocityRa
VelocityRa / relocations.cpp
Created September 6, 2018 14:46
Vita3K WIP code for newly discovered relocation entry types
// Vita3K emulator project
// Copyright (C) 2018 Vita3K team
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
const DEMO_MODE : bool = false;
fn get_digit(num: u32, index: u32) -> u8 {
(num / 10u32.pow(index) % 10) as u8
}
/* Returns true if a number was emitted */
fn emit_units_tens_hundreds(num: u32, str: &mut String) -> bool {
let units_names = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"];
let tens_names = ["", "ten", "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninety"];
@VelocityRa
VelocityRa / DNG.bt
Created April 20, 2020 16:34
010 Editor Template for .DNG files. Based on TIF.v1.7 template.
//------------------------------------------------
//--- 010 Editor v2.1 Binary Template
//
// File: TIF.bt
// Authors: Kevin O. Grover
// E-mail: kevin@kevingrover.net
// Version: 1.7
// Purpose: A template for parsing TIFF (Tagged Image File Format) files. Also now handles GeoTIFF files.
// Category: Image
// File Mask: *.tif,*.tiff