Skip to content

Instantly share code, notes, and snippets.

View kamirr's full-sized avatar
🐴
horse

Kamil Koczurek kamirr

🐴
horse
  • Golem Factory
  • Poland
View GitHub Profile
/* Sample range-based clamp implementation */
#include <iostream>
#include <vector>
#include <limits>
#include <cmath>
#include <map>
class PrimeNumbers {
std::map<size_t, bool> primeMap = {{2, true}};
std::vector<size_t> prime = {2};
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
template<typename T, typename U>
std::pair<const std::vector<T>&, const U&> printable_vector(const std::vector<T>& vec, const U& separator) {
return std::pair<const std::vector<T>&, const U&>({vec, separator});
}
#include <iostream>
#include <string>
#include <vector>
#include <random>
class randomMachine {
private:
std::random_device rd;
std::mt19937 mt;
/* Sample range-based clamp implementation */
#include <iostream>
#include <vector>
template<typename T>
struct Range {
T lowest;
T highest;
};
net = require('net');
String.prototype.hashCode = function() {
var hash = 0, i, chr, len;
if (this.length === 0) return hash;
for (i = 0, len = this.length; i < len; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
}
@kamirr
kamirr / main.cpp
Created November 3, 2016 20:01
main.cpp
#include <SFML/Graphics.hpp>
#include <iostream>
#include <cassert>
#include <vector>
#include <memory>
class GameObject:
public sf::Drawable {
private:
static size_t m_count;
#include "thread_safe_shared_ptr.h"
#include <chrono>
#include <thread>
/* data_type has to provide operators "int" and "=" */
typedef int data_type;
typedef ts_mem::thread_safe_shared_ptr<data_type> ts_data_type_ptr;
/* Update time every "second" */
void f(ts_data_type_ptr p)
/* =============================================================*
* Trengine (c) Dmitro bjornus Szewczuk | dmitro.szewczuk@wp.pl *
* zlib License https://opensource.org/licenses/Zlib *
* =========================================================== */
#include "../../headers/Device.hpp"
#include "../../headers/Shader.hpp"
#include "../../headers/Scene.hpp"
using namespace trengine;
#pragma once
#include <ostream>
namespace trengine
{
struct vec3
{
float x, y, z;
TEMPLATE = app
TARGET = MinimalPlusPlus
INCLUDEPATH += .
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# Input
HEADERS += includes.hpp \
window.hpp \