Skip to content

Instantly share code, notes, and snippets.

Scott Prager splinterofchaos

Block or report user

Report or block splinterofchaos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gita.profile
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 <Bram@vim.org>
" Last Change: 2001 Sep 12
@splinterofchaos
splinterofchaos / nasync.vim
Last active Aug 29, 2015
A small script for running asynchronous nvim commands.
View nasync.vim
" 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
View term-test.vim
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') })
View proj.cpp
#include <algorithm>
#include <cassert>
#include <functional>
#include <iostream>
#include <vector>
#include <fu/fu.h>
struct Person {
@splinterofchaos
splinterofchaos / Py.h
Last active Aug 29, 2015
Python API in C++
View Py.h
#ifndef PY_H
#define PY_H
#include <Python.h>
#include <type_traits>
#include <utility>
#include <string>
template<typename R, typename...X>
View gist:7985be54515f72124883
==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)
View proc.vim
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()
@splinterofchaos
splinterofchaos / Makefile
Created Oct 6, 2014
Uv stdout and stderr
View Makefile
a.out : err.c
gcc err.c
@splinterofchaos
splinterofchaos / log
Created Aug 30, 2014
neovim log on segfault
View log
2014/08/30 00:51:15 [debug @ requeue_deferred_events:209] 7437 - Number of deferred events: 0
2014/08/30 00:51:15 [debug @ requeue_deferred_events:219] 7437 - Number of deferred events: 0
2014/08/30 00:51:15 [debug @ process_from:185] 7437 - Processed 0 events
2014/08/30 00:51:15 [debug @ loop:237] 7437 - Enter event loop
2014/08/30 00:51:15 [debug @ read_cb:271] 7437 - Received 1 bytes from RStream(address: 0x277dc10, source: 0x277dc10)
2014/08/30 00:51:15 [debug @ loop:239] 7437 - Exit event loop
2014/08/30 00:51:15 [debug @ process_from:185] 7437 - Processed 0 events
2014/08/30 00:51:15 [debug @ requeue_deferred_events:209] 7437 - Number of deferred events: 1
2014/08/30 00:51:15 [debug @ requeue_deferred_events:216] 7437 - Re-queueing event
2014/08/30 00:51:15 [debug @ requeue_deferred_events:219] 7437 - Number of deferred events: 1
@splinterofchaos
splinterofchaos / clang.s
Last active Aug 29, 2015
concat_fnames assembly
View clang.s
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbp
# kill: RDI<def> RBP<kill>
callq strlen
movq %rax, %rbx
movq %r14, %rdi
callq strlen
leaq 3(%rbx,%rax), %rdi
callq xmalloc
You can’t perform that action at this time.