Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

" pathogen plugin management
" execute pathogen#infect('~/.config/nvim/bundle/{}')
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin()
@jsonnull
jsonnull / nightowl.itermcolors
Created May 28, 2018 01:42
Want to preview? Go to https://terminal.sexy, then use Import -> iTerm2 and copy/paste this gist contents into the text area
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Color Space</key>
<string>sRGB</string>
<key>Blue Component</key>
<real>0.15294117647058825</real>
@jsonnull
jsonnull / .vimrc
Created November 18, 2016 17:31
My vim configuration
" pathogen plugin management
execute pathogen#infect()
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@jsonnull
jsonnull / xterm-256color-italic.terminfo
Created November 4, 2016 22:08 — forked from sos4nt/xterm-256color-italic.terminfo
A xterm-256color based TERMINFO that adds the escape sequences for italic
# A xterm-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic xterm-256color-italic.terminfo
#
# Usage:
#
# export TERM=xterm-256color-italic
#
@jsonnull
jsonnull / traversalOrder.js
Created September 22, 2016 04:00
Determining octree traversal order for raycasting
/*
* Quick and dirty attempt:
*/
// Once per ray cast, determine the full traversal order
function getTraversalOrder(direction: [number, number, number]): Array<number> {
// Should we test positive side child nodes first?
const posXFirst: boolean = direction[0] < 0
const posYFirst: boolean = direction[1] < 0
const posZFirst: boolean = direction[2] < 0
@jsonnull
jsonnull / render-logic.js
Created August 30, 2016 23:28 — forked from markerikson/render-logic.js
React render function organization
class ParentComponent extends Component {
render() {
const {a, b, someBoolean, someList} = this.props;
const conditionalComponent = someBoolean ? <SomeComponent /> : null;
const listItems = someList.map(item => <ListItem item={item} />);
return (
<div>
<div>A: {a}, B: {b}</div>
{conditionalComponent}
@jsonnull
jsonnull / jsx-h.js
Created December 24, 2015 04:02 — forked from jollytoad/jsx-h.js
Wrapper for virtual-dom/h to support compiled JSX (ES6)
import h from 'virtual-dom/h'
export default function(tag, props, ...children) {
return h(tag, transformProps(props), children)
}
// Add any attribute -> property mapping in here that you may want
const attrMap = {
"class": "className"
}
@jsonnull
jsonnull / chain.js
Last active December 26, 2015 10:29
Just a simple hack I came up with to facilitate really short pattern-matching. It is effectively a chain of if-elseif statements. The first time a condition is true, the associated expression or code block is evaluated, and nothing further.
var x = false,
y = true;
// Call functions in the evaluation
(x && y)? alert("x and y matched")
: x? alert("x matched")
: y? alert("y matched")
: alert("default")