Skip to content

Instantly share code, notes, and snippets.

View Aegean-Homines's full-sized avatar

Egemen Koku Aegean-Homines

View GitHub Profile
$ git log --author="Egemen Koku" --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "\nadded lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' -
$ git log --author="Egemen Koku" --pretty=tformat: --numstat | grep "Whisky Engine/Source" | gawk '{ add += $1 ; subs += $2 ; loc += $1 - $2 } END { printf "added lines: %s removed lines : %s total lines: %s\n",add,subs,loc }' -
void MyFunction( Enum_Name_Here value )
{
// NOTE = also define another header, include all EnumName.h files to generate all enums on compile time
return GetStringEnum_Name_Here(value);
}
@Aegean-Homines
Aegean-Homines / ClosestPrime.cpp
Created April 10, 2017 23:36
Closest Prime Number function by Julian M Bucknall
/*********************************************************/
/* C Modification of primes table */
/* TDPrimes.INC */
/* Copyright (c) Julian M Bucknall 1997, 2001 */
/* All rights reserved. */
/*********************************************************/
/* Prime number array include file (auto-generated) */
/* This will find prime numbers up to about 16.8 million */
/*********************************************************/
@Aegean-Homines
Aegean-Homines / gist:60d457a6065738338a21aef4c5482a12
Created August 16, 2017 19:15
isnan function taken from isocpp faq website
inline bool my_isnan(double x)
{
return x != x;
}
@Aegean-Homines
Aegean-Homines / Setting.JSON
Created August 18, 2017 21:53
Settings file for the WhiskyEngine
{
"ArchetypeJsonLocation": "Archetypes/Archetypes.json",
"AudioJsonLocation": "Resources/Audio.json",
"TextureJsonLocation": "Resources/Texture.json",
"SfmlMusicJsonTag": "SFMLMusic",
"SfmlSoundJsonTag": "SFMLSound",
"EngineLevelFileLocation":"Levels/",
"EngineLevels": ["Tutorial.json", "Level1.json", "Level2.json", "Level3.json"],
@Aegean-Homines
Aegean-Homines / ExampleLevel.json
Created August 18, 2017 22:02
An example level file
{
"GameObjectList": [
{
"Light": {
"Tag": "Light",
"ModelComponent": {
"Type": "CUBE",
"Color": "white",
"Unlit": true
},
@Aegean-Homines
Aegean-Homines / BT.cpp
Last active September 2, 2017 00:51
General tree structure using template of template
#ifndef BINARY_TREE_CPP
#define BINARY_TREE_CPP
#include "BT.h"
template<typename T>
BT<T>::BT(T const & data): NodeInterface<T>(data) {
}
@Aegean-Homines
Aegean-Homines / HashFunctions.h
Last active January 18, 2022 18:21
Different Hash Functions (thanks to Prof. Volper)
/*
COMPARISON
keylen = 512, iterations = 100000
====================================
Simple... 0.078 s
RS... 0.422 s
RS (Fast)... 0.156 s
Universal... 0.454 s
Universal (Fast)... 0.156 s
PJW... 0.328 s