This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <class T, int SIZE> struct vec { | |
template <class... S> vec(const S& ... args) : data {args...} {} | |
bool operator==(const vec &v) const { | |
for(int i=0; i<SIZE; i++) | |
if(v[i] != data[i]) return false; | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <unordered_map> | |
#include <functional> | |
#include <vector> | |
#include <assert.h> | |
#include <stdio.h> | |
/* | |
template <typename T> class InjectionPoint { | |
public: | |
bool apply(T &arg) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef MUSIC | |
#include "ModPlugin.h" | |
#include "ChipPlayer.h" | |
#endif | |
#include <grappix/grappix.h> | |
#include <SDL/SDL.h> | |
using namespace grappix; | |
using namespace utils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <coreutils/utils.h> | |
#include <coreutils/log.h> | |
#include "v8/v8.h" | |
#include <string> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! FindFunction(name) | |
cexpr! system('ag --vimgrep -G ".(cs\|c\|cpp\|h\|java)$" "[A-Za-z\*]+\s+([A-Za-z_]+::)?' . a:name . '\s*\([^\)]*\)\s*(?=\{)"') | |
endfunction | |
function! FindClass(name) | |
cexpr! system('ag --vimgrep -G ".(cs\|c\|cpp\|h\|java)$" "(class\|struct\|interface)\s+([A-Za-z_]+\s+)*' . a:name . '\s+(?!;)"') | |
endfunction | |
nmap <leader>af "zyiw:call FindFunction(@z)<cr> | |
nmap <leader>ac "zyiw:call FindClass(@z)<cr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Why exceptions | |
int test() | |
{ | |
strint contents = File("data.txt").readAllText(); | |
File myRoot, otherRoot; | |
myRoot.forEachFile([](const File &f) { | |
if(f.suffix() == "xxx") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.conv; | |
import std.exception; | |
import diesel; | |
import ansi; | |
import textscreen; | |
import std.string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <functional> | |
#include <string> | |
#if __cplusplus <= 201200L | |
namespace std { | |
// index_sequence |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os.path | |
import subprocess | |
import platform | |
osname = platform.system() | |
def which(program): | |
import os | |
def is_exe(fpath): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <tuple> | |
#include <cstdio> | |
template<typename UnaryFunction> | |
void invoke_with_arg(UnaryFunction) | |
{} | |
/** |
OlderNewer