Skip to content

Instantly share code, notes, and snippets.

View VelocityRa's full-sized avatar

Nick Renieris VelocityRa

View GitHub Profile
@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();
glActiveTexture
glAttachShader
glBeginQuery
glBeginTransformFeedback
glBindBuffer
glBindBufferBase
glBindBufferRange
glBindFramebuffer
glBindProgramPipeline
glBindSampler
// 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>
@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
@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 / 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