This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FrameTime { | |
constructor() { | |
this.parent = document.body; | |
this.lastTime = performance.now(); | |
this.lastFrameTime = 0.0; | |
this.frameCounter = 0; | |
this.accumulatedTime = 0.0; | |
this.framesPerSecond = 0.0; | |
this.container = document.createElement('div'); | |
this.container.style.position = 'fixed'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LinkedList | |
{ | |
struct Node | |
{ | |
Node* next; | |
int value; | |
}; | |
LinkedList(std::initializer_list<int> list) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include <stack> | |
int partition(std::vector<int>& input, int left, int right) | |
{ | |
if (left < right) | |
{ | |
int pivotValue = input[right]; | |
// This represent the current position of the pivot | |
int pivotIndex = left; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*.sln | |
*.suo | |
*.opensdf | |
*.sdf | |
/Engine/DerivedDataCache/* | |
**/DerivedDataCache/Boot.ddc | |
**/DerivedDataCache/**/*.udd | |
*/Intermediate/* | |
*/Saved/* | |
/Engine/Programs/UnrealBuildTool/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
for %%f in (*.zip.*) do ( | |
set "filename=%%f" | |
if /i not "!filename:~-4!"==".zip" ( | |
echo Renaming !filename! to !filename!.zip | |
ren "!filename!" "!filename!.zip" | |
) else ( | |
set "restoredFilename=!filename:~0,-4!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
exp = re.compile("\.zip\.\d+") | |
for file_name in os.listdir("./"): | |
if exp.search(file_name): | |
if not file_name.endswith(".zip"): | |
print("Renaming " + file_name + " to " + file_name + ".zip") | |
os.rename(file_name, file_name + ".zip") | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* x64 Fast tiny pool of 64 elements that allows random allocation and freeing */ | |
/* by Felipe Alfonso - http://voitptr.io */ | |
#include <stdint.h> | |
#if _WIN32 | |
#include <intrin.h> | |
#endif | |
template<typename T> | |
struct TinyPool | |
{ | |
#if _WIN32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the WebGL code: | |
// ====================== | |
// GL function shortcuts taken from: http://xem.github.io/articles/archive.html#webgl_quest | |
for(i in g)g[i[0]+i[6]]=g[i]; | |
// `with` helps us avoid doing g.xxx() and just do xxx() | |
with(g) | |
// Time variable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Everything except stb_image was made by Felipe Alfonso (@bitnenfer) | |
// | |
// This is a crappy software but it does what it needed from it. It just | |
// transform images (PNG, JPG, TGA, etc.) to DMG encoded tiles. It wont check | |
// for repeating tiles. Maybe in the future I can add that. | |
// | |
// Compile with GCC. gcc img2dmg.c -o img2dmg | |
// and it's done. | |
// | |
// Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cls | |
rem ================================================ | |
rem ================================================ | |
rem The project structure looks like this: | |
rem ROOT_PATH/ | |
rem PROJECT_NAME/ | |
rem code/ |
NewerOlder