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
using System.IO; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
// Full disclosure: This is based on another gist, but I neglected to write down the link to it. | |
[CreateAssetMenu] | |
public class IconPacker : ScriptableObject { | |
public Texture2D[] textures; |
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
// compile with g++ ecs.cpp -std=c++2a -o run && ./run | |
// Taken from my project, https://github.com/splinterofchaos/py-srpg | |
#include <vector> | |
#include <tuple> | |
#include <iostream> | |
template<typename F, typename...T> | |
constexpr auto tuple_map(F&& f, const std::tuple<T...>& t) { | |
return std::tuple(f(std::get<T>(t))...); |
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
struct Seq { | |
size_t start, size; | |
}; | |
ostream& operator<<(ostream& os, const Seq& s) { | |
return os << "[" << s.start << ", " << s.size << ")"; | |
} | |
// Returns the number of replacements or additions required to break sequences to have no triplets. |
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
SCRIPT /usr/local/share/nvim/runtime/syntax/syncolor.vim | |
Sourced 1 time | |
Total time: 0.001307 | |
Self time: 0.001307 | |
count total (s) self (s) | |
" Vim syntax support file | |
" Maintainer: Bram Moolenaar <[email protected]> | |
" Last Change: 2001 Sep 12 | |
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
" From an embedded instance, evaluates an expression and sends the result back | |
" to the parent instance to be executed by a callback. | |
function! nasync#up(expr, callback) | |
call rpcnotify(1, 'vim_eval', a:callback . '(' . string(eval(a:expr)) . ')') | |
endfunction | |
function! s:arg_str(...) | |
return join(map(copy(a:000), "string(v:val)"), ',') | |
endfunction |
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
let s:buf = -1 | |
function! s:exit_handler() | |
execute 'bdelete!' s:buf | |
endfunction | |
function! s:test() | |
vnew | |
let s:buf = bufnr('%') | |
let id = termopen('sleep 1', { 'on_exit': function('s:exit_handler') }) |
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 <algorithm> | |
#include <cassert> | |
#include <functional> | |
#include <iostream> | |
#include <vector> | |
#include <fu/fu.h> | |
struct Person { |
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
#ifndef PY_H | |
#define PY_H | |
#include <Python.h> | |
#include <type_traits> | |
#include <utility> | |
#include <string> | |
template<typename R, typename...X> |
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
==18492== Memcheck, a memory error detector | |
==18492== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
==18492== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info | |
==18492== Command: nvim | |
==18492== Parent PID: 21288 | |
==18492== | |
==18492== Invalid read of size 4 | |
==18492== at 0x4B2ED1: copy_tv (eval.c:16794) | |
==18492== by 0x4B15BE: get_var_tv (eval.c:15965) | |
==18492== by 0x499294: eval7 (eval.c:4114) |
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
let s:buf = 0 " The buffer we use to write/send data. | |
let s:job = 0 " The job that runs the commands. | |
let s:inbuf = '' " Data pending, sending to s:job. | |
command! Proc call s:new() | |
command! -nargs=* ProcDoLine call s:do_cmd(<f-args>) | |
command! ProcStop call jobstop(s:job) | |
command! ProcPressEnter call s:on_enter() |
NewerOlder