Skip to content

Instantly share code, notes, and snippets.

@vittorioromeo
vittorioromeo / gist:6867938
Created October 7, 2013 13:24
subl preferences
{
"auto_match_enabled": false,
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Monokai Extended/Monokai Extended Bright.tmTheme",
"font_face": "lemon",
"font_size": 8,
"ignored_packages":
[
"Vintage"
#!/bin/bash
#g++ -O3 -DNDEBUG -std=c++11 -Wall -Wextra -W -pedantic -pthread "$@"
#clang++ -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wcomment -Wchar-subscripts -Wenum-compare -Wformat -Wimplicit -Wimport -Winline -Wlarger-than- -Wmissing-declarations -Wnested-externs -Woverloaded-virtual -Wparentheses -Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch -Wsynth -Wtypename-missing -Wuninitialized -Wunused -Wwrite-strings "$@" #-fsanitize=address-full -g -O0
#clang++ -O3 -DNDEBUG -std=c++11 -Wall -Wextra -W -pedantic -pthread -Weffc++ "$@" -fsanitize=float-divide-by-zero -fsanitize=undefined -fsanitize=integer -fsanitize=bool -fsanitize=enum -fsanitize=bounds -fsanitize=integer-divide-by-zero -fsanitize=null -fsanitize=return -fsanitize=unreachable -fsanitize=vptr
#clang++ -g -g3 -std=c++11 -Wall -Wextra -W -pedantic -pthread -Weffc++ "$@" -fsanitize=float-divide-by-zero -fsanitize=undefined -fsanitize=integer -fsanitize=bool -fsanitize=enum -fsanitize=bound
@vittorioromeo
vittorioromeo / ecstests.hpp
Last active December 25, 2015 00:59
entity/component system tests
#include <stack>
#include <vector>
#include <tuple>
#include <numeric>
#include <cstdint>
#include <array>
#include <cassert>
#include <unordered_map>
#include <bitset>
#include <SSVUtils/SSVUtils.h>
@vittorioromeo
vittorioromeo / arkanoid.cpp
Created October 13, 2013 16:40
Arkanoid in 170 lines of C++11 and SFML2
#include <vector>
#include <random>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
constexpr float raggioPallina{5.f};
constexpr float lunghezzaBlocco{60.f}, altezzaBlocco{20.f};
2>&1 | asan_symbolize.py | c++filt
template<typename T> class IdxIterator
{
private:
T* container;
std::size_t idx;
public:
inline IdxIterator(T* mContainer, std::size_t mIdx) noexcept : container{mContainer}, idx{mIdx} { }
inline IdxIterator(const IdxIterator& mOther) noexcept = default;
#!/bin/bash
(
cd /home/vittorioromeo/WEBVittorioRomeo2/
git pull
git submodule foreach git pull origin master
cd ./_RELEASE/
cmake ..
make -j2
sudo make install
@vittorioromeo
vittorioromeo / imageOutliner.cpp
Created November 28, 2013 15:22
Takes an image as an input, returns the same image, outlined by 1px, as output.
// Copyright (c) 2013 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: http://opensource.org/licenses/AFL-3.0
#define SSVS_N_USE_JSON
#include <vector>
#include <string>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
// This will save your sanity.
#include <cfenv>
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
#include <thread>
#include <string>
#include <iostream>
#include <SSVUtils/SSVUtils.hpp>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
namespace ssvgl
{
class ShaderSource;