Skip to content

Instantly share code, notes, and snippets.

Vittorio Romeo SuperV1234

Block or report user

Report or block SuperV1234

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:4971391
vector<AABB> getMergedAABBSLeft(vector<AABB> mSource)
vector<AABB> result;
bool merged{false}; AABB a{mSource.back()}; mSource.pop_back();
for(auto& b : mSource)
if(a.getRight() == b.getRight())
View tokenizerTest.cpp
vector<string> specials{"{", "}", "[", "]", "(", ")"};
vector<string> keywords{"if", "else"};
enum class TokenType{Symbol, Keyword, Special, Numeric};
bool isKeyword(const std::string& mValue) { return contains(keywords, mValue); }
bool isSpecial(const std::string& mValue) { return contains(specials, mValue); }
bool isNumeric(const std::string& mValue) { for(const auto& c : mValue) if(!isdigit(c)) return false; return true; }
struct Token
SuperV1234 / gist:5792381
Last active Dec 18, 2015
Strange lambda bug (machine-dependent compiler bug?)
View gist:5792381
// Test 1 works
// Test 2 segfaults... on some machines.
// Compiled with -std=c++11, GCC 4.8.1, tested both on native Linux, Windows and Wine
#include <iostream>
#include <functional>
#include <vector>
using namespace std;
SuperV1234 / Text.cpp
Created Jun 24, 2013
Optimizations to sf::Text - adding a "must update geometry" flag to avoid unnecessary recalculations
View Text.cpp
// SFML - Simple and Fast Multimedia Library
// Copyright (C) 2007-2013 Laurent Gomila (
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
SuperV1234 /
Last active Dec 19, 2015
This script backups the whole filesystem. It stores the last 15 backup folders in a text file, '_LAST', and rotates the backups by deleting the fifteenth folder (and text line).
# Set directories
# Get all entries from LASTENTRIESFILE (one entry per line) and put them in the LASTENTRIES array
SuperV1234 /
Created Jul 2, 2013
Builds and installs both debug and release CMake configurations in all subfolders non-recursively
echo "Password, please!"
sudo echo "Thanks!"
for dir in ./*; do
if [[ -d "$dir" ]]; then
cd "$dir"
mkdir "buildAll"
SuperV1234 / GridMain.cpp
Created Jul 4, 2013
Philip Diffenderfer's grid spatial partitioning implementation
View GridMain.cpp
#include <cstdlib>
#include <cmath>
#include <iostream>
#ifdef _WIN32
#include "sys\time.h"
#include <windows.h>
#include "sys/time.h"
SuperV1234 /
Last active Dec 19, 2015
1-click build for Open Hexagon (both for Arch and Debian/Ubuntu) Open Hexagon Windows build helper (requires human intervention) Open Hexagon Release build helper
# This bash script, called in a repository with submodules, builds and installs all submodules then the project itself
# Takes $1 destination directory parameter
if [ -z "${1}" ]; then
echo "This script the installation path as an argument!"
exit 1
SuperV1234 / Client.cpp
Created Jul 17, 2013
temp server/client
View Client.cpp
#include <iostream>
#include <algorithm>
#include <string>
#include <thread>
#include <functional>
#include <future>
#include <SSVUtils/SSVUtils.h>
#include <SFML/Network.hpp>
#include "Common.h"
View Tokenizer.h
#include <string>
#include <vector>
#include <unordered_map>
#include <functional>
#include "SSVUtils/Utils/UtilsContainers.h"
#include "SSVUtils/Log/Log.h"
#include "SSVUtils/Global/Typedefs.h"
You can’t perform that action at this time.