Skip to content

Instantly share code, notes, and snippets.

Avatar

Egemen Koku Aegean-Homines

View GitHub Profile
@Aegean-Homines
Aegean-Homines / BT.cpp
Last active Sep 2, 2017
General tree structure using template of template
View BT.cpp
#ifndef BINARY_TREE_CPP
#define BINARY_TREE_CPP
#include "BT.h"
template<typename T>
BT<T>::BT(T const & data): NodeInterface<T>(data) {
}
View ExampleLevel.json
{
"GameObjectList": [
{
"Light": {
"Tag": "Light",
"ModelComponent": {
"Type": "CUBE",
"Color": "white",
"Unlit": true
},
@Aegean-Homines
Aegean-Homines / Setting.JSON
Created Aug 18, 2017
Settings file for the WhiskyEngine
View Setting.JSON
{
"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 / gist:60d457a6065738338a21aef4c5482a12
Created Aug 16, 2017
isnan function taken from isocpp faq website
View gist:60d457a6065738338a21aef4c5482a12
inline bool my_isnan(double x)
{
return x != x;
}
@Aegean-Homines
Aegean-Homines / ClosestPrime.cpp
Created Apr 10, 2017
Closest Prime Number function by Julian M Bucknall
View ClosestPrime.cpp
/*********************************************************/
/* 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 / HashFunctions.h
Last active Apr 10, 2017
Different Hash Functions (thanks to Prof. Volper)
View HashFunctions.h
/*
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
View ClassEnumIsUsed
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);
}
View LoC just source
$ 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 }' -
View Git contribution lines macro
$ 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 }' -