Skip to content

Instantly share code, notes, and snippets.

View HalanoSiblee's full-sized avatar
:octocat:
Open source supporting force

Halano HalanoSiblee

:octocat:
Open source supporting force
View GitHub Profile
@user-grinch
user-grinch / hook.cpp
Last active December 29, 2024 10:03
GTA III VC SA DirectX Hooking Class
#include "pch.h"
#include "d3dhook.h"
#include "kiero/kiero.h"
#include "kiero/minhook/MinHook.h"
#include "imgui/imgui_impl_dx9.h"
#include "imgui/imgui_impl_dx11.h"
#include "imgui/imgui_impl_win32.h"
#include "../include/fonts/fonts.h"
#include "../trainer.h"
#include "../pages/menu.h"
@OrionReed
OrionReed / dom3d.js
Last active May 15, 2025 11:15
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@rofl0r
rofl0r / github_2fa_oathtool.md
Created October 11, 2023 21:54
Using Github 2FA with oathtool

I've been forced by github to enable 2FA with the following banner:

GitHub users are now required to enable two-factor authentication as an additional security measure. Your activity on GitHub includes you in this requirement. You will need to enable two-factor authentication on your account before October 12, 2023, or be restricted from account actions.

Fortunately, i managed to make the switch using the FLOSS oathtool, a non-bloated CLI program written in C.

Once you click the "Enable 2FA" button, github presents you a barcode and a link to uncover the embedded "setup key". All you really need is the setup key, which as it turns out is Base32-encoded. The next step is to enter a 6-digit code supplied by the TOTP app. Here it is extremely important that your system clock is correct, best to sync with NTP directly before use.

@chrplr
chrplr / playwav_withsdl2.c
Created May 26, 2021 13:03
playing a single sound file (wav) with SDL2
/* Play a sound file (wav format) passed on the command line, using libsdl2
*
* Time-stamp: <2021-05-26 14:58:39 [email protected]>
*
* Compile with:
* cc -W -Wall $(sdl2-config --cflags) test_playsound.c $(sdl2-config --libs) -o test_playsound
*/
#include <stdio.h>
#include <SDL2/SDL.h>
@qzm
qzm / aria2.conf
Last active May 12, 2025 04:23
Best aria2 Config
### Basic ###
# The directory to store the downloaded file.
dir=${HOME}/Downloads
# Downloads the URIs listed in FILE.
input-file=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to FILE on exit.
save-session=${HOME}/.aria2/aria2.session
# Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits. Default: 0
save-session-interval=60
# Set the maximum number of parallel downloads for every queue item. See also the --split option. Default: 5
@dreampiggy
dreampiggy / mov2webp.sh
Created March 6, 2017 05:31
ffmpeg MOV to Animated WebP
ffmpeg -i input.mov -vcodec libwebp -lossless 1 -q:60 -preset default -loop 0 -an -vsync 0 output.webp
@jonaslsaa
jonaslsaa / telnetserver.py
Created December 25, 2015 11:22
Python Socket Telnet Chat Room (Python 3.5.1)
import socket
import sys
from _thread import *
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clients = []
host = ''
port = 23
chat = ""
print("\n"*50)
@graphicbeacon
graphicbeacon / chat-server.js
Last active May 13, 2025 21:23
A simple TCP chat server with NodeJS, based on the example provided by creationix.
var net = require('net');
var sockets = [];
var port = 8000;
var guestId = 0;
var server = net.createServer(function(socket) {
// Increment
guestId++;
socket.nickname = "Guest" + guestId;
@armornick
armornick / playwav.c
Created August 24, 2012 07:31
Play a sound with SDL2 (no SDL_Mixer)
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
@ecin
ecin / phantomjs_facebook.js
Created April 23, 2012 21:06
Log into Facebook with phantomJS
console.log("got here");
var page = require('webpage').create();
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.open("http://facebook.com", function(status) {
if ( status === "success" ) {