Skip to content

Instantly share code, notes, and snippets.

@Rapptz
Rapptz / Bootstrap.py
Created September 2, 2013 04:24
Compilation helper. bootstrap
#!/usr/bin/env python
# Python 2.7
import os
import sys
import errno
import glob
# Meta data
project_name = 'untitled'
# This file has been generated by shinobi version 0.9.5
ninja_required_version = 1.3
builddir = bin
objdir = obj
cxx = g++
cxxflags = -std=c++11 -pedantic -pedantic-errors -Wextra -Wall -O2 -DNDEBUG
incflags = -I"."
linkflags = -static
#include <sol.hpp>
#include <iostream>
#include <tuple>
void breaking() {
std::cout << "Nice!~\n";
}
std::tuple<double, double> breaking_multi() {
return std::make_tuple(567.2, 2.567);
#include <type_traits>
#include <iterator>
#include <initializer_list>
#include <stdexcept>
template<typename T>
using StorageFor = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
template<typename T, size_t N>
struct static_vector {
@Rapptz
Rapptz / hscards.json
Last active February 27, 2021 14:24
Hearthstone Cards
[
{
"id": 7,
"name": "Garrosh Hellscream",
"description": "",
"image": "http:\/\/wow.zamimg.com\/images\/hearthstone\/cards\/enus\/medium\/HERO_01.png",
"class": "warrior",
"type": "hero",
"quality": "free",
"race": "none",
@Rapptz
Rapptz / fun.cpp
Created February 22, 2014 22:45
Herding Simulator 2014
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <random>
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_int_distribution<> dist(5, 30);
static std::uniform_int_distribution<> negator(0, 1);
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <random>
#include <map>
#include <stdexcept>
#include <functional>
#include <cstdlib>
import sublime, sublime_plugin
def open_url(url):
sublime.active_window().run_command("open_url", { "url": url })
class PromptQuickDocCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.show_input_panel("Documentation Search:", "", self.on_done, None, None)
pass
// The MIT License (MIT)
// Copyright (c) 2013-2014 Rapptz, Danny Y.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify,
// merge, publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so, subject to the
// following conditions:
local vector = {}
vector.__index = vector
local function is_vector(t)
return getmetatable(t) == vector
end
function vector.new(x, y)
return setmetatable({ x = x or 0, y = y or 0 }, vector)
end