Skip to content

Instantly share code, notes, and snippets.

View haseeb-heaven's full-sized avatar
🏠
Working from home

HeavenHM haseeb-heaven

🏠
Working from home
View GitHub Profile
@MatthewSteel
MatthewSteel / ttt.c
Created July 22, 2012 05:35
Minimax (full tree search) tic-tac-toe AI in C
//Tic-tac-toe playing AI. Exhaustive tree-search. WTFPL
//Matthew Steel 2009, www.www.repsilat.com
#include <stdio.h>
char gridChar(int i) {
switch(i) {
case -1:
return 'X';
case 0:
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@dstebila
dstebila / bin2hex.sh
Created October 21, 2014 18:10
Shell script to convert binary to hex
#!/bin/bash
# Read either the first argument or from stdin (http://stackoverflow.com/questions/6980090/bash-read-from-file-or-stdin)
cat "${1:-/dev/stdin}" | \
# Convert binary to hex using xxd in plain hexdump style
xxd -ps | \
# Put spaces between each pair of hex characters
sed -E 's/(..)/\1 /g' | \
# Merge lines
tr -d '\n'
@haseeb-heaven
haseeb-heaven / FileSummary.cpp
Last active October 12, 2021 23:07
Prints file summary all printable, non-printable characters from any file , or strings extraction from any file just like GNU 'strings'. tool.
/*File summary - Prints file summary all printable, non-printable characters from any file.
Can also works as strings extraction from any file just like GNU 'strings'. tool.
By Artic Coder.
*/
#include <iostream>
#include <fstream>
#include <vector>
std::string ReadFile(std::string file_name);
@haseeb-heaven
haseeb-heaven / AsciiTextGenerator.c
Last active June 15, 2022 10:11
AsciiTextGenerator is text generator like FIGlet fonts.
/*Ascii text Generator in C. - Convert your text or any text to fancy ASCII font.
Artic Coder */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define TEXT_LEN 0x64
#define FONT_HEIGHT 5
#define FONT_WIDTH 53
@krummler
krummler / String+CheckEmoji.swift
Last active July 7, 2022 10:39
Emoji checking, with some legacy code
import Foundation
extension UnicodeScalar {
/// Note: This method is part of Swift 5, so you can omit this.
/// See: https://developer.apple.com/documentation/swift/unicode/scalar
var isEmoji: Bool {
switch value {
case 0x1F600...0x1F64F, // Emoticons
0x1F300...0x1F5FF, // Misc Symbols and Pictographs
0x1F680...0x1F6FF, // Transport and Map
@codecat
codecat / Webservices.md
Last active May 11, 2024 22:51
Trackmania Webservices

New documentation

Note: There is a newly maintained community documentation site for all of Trackmania's APIs!

Visit it at: https://webservices.openplanet.dev/

Authentication setup

This guide will explain how to authenticate with Nadeo's API. There are 2 methods of doing so, one is via a Ubisoft account, and one is via a dedicated server account. Note that the dedicated server account way is easier but imposes some limitations on what you can access with the API, but it could be enough.

Refer to my Nadeo Go package for a complete example.

/* AutoCloseMessageBox - C++ Implementation of original code of C# from CodeProject https://www.codeproject.com/Articles/7968/MessageBox-with-a-timeout-for-NET
By Artic Coder.
*/
#undef UNICODE
#include <iostream>
#include <Windows.h>
using std::string;
//Pointer to Hook functions.
/**
* @description - Read any ASCII,BINARY or HEX file.
* @param - Source file name and file type.
* @return - Returns data in tuple format,use std::get<TUPLE_ID>(TUPLE_OBJ) to get data.
*/
/*Including STD-C++ libraries*/
#include <iostream> /*For basic I/O.*/
#include <fstream> /*For basic I/O.*/
#include <sstream> /*For basic I/O.*/
#include <vector> /*For STL vector.*/