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;
while(!mSource.empty())
{
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
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
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 (laurent.gom@gmail.com)
//
// 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
SuperV1234 / backup-system.sh
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).
View backup-system.sh
#!/bin/bash
# Set directories
BACKUPDIR="/media/veeBackup/_ARCHBACKUP/"
TEMPDIR="${BACKUPDIR}_TEMP/"
TEMPFILE="${TEMPDIR}tmpfile"
LASTENTRIESFILE="${BACKUPDIR}_LAST"
# Get all entries from LASTENTRIESFILE (one entry per line) and put them in the LASTENTRIES array
OLD_IFS=$IFS
@SuperV1234
SuperV1234 / build-all.sh
Created Jul 2, 2013
Builds and installs both debug and release CMake configurations in all subfolders non-recursively
View build-all.sh
#!/bin/bash
echo "Password, please!"
sudo echo "Thanks!"
for dir in ./*; do
if [[ -d "$dir" ]]; then
(
cd "$dir"
mkdir "buildAll"
@SuperV1234
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>
#else
#include "sys/time.h"
#endif
@SuperV1234
SuperV1234 / build-oh-rel.sh
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
View build-oh-rel.sh
#!/bin/bash
# This bash script, called in a repository with submodules, builds and installs all submodules then the project itself
# RELEASE MODE, SKIPS RPATH
# Takes $1 destination directory parameter
if [ -z "${1}" ]; then
echo "This script the installation path as an argument!"
exit 1
fi
@SuperV1234
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
#ifndef SSVU_TOKENIZER
#define SSVU_TOKENIZER
#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.