Skip to content

Instantly share code, notes, and snippets.

@irrationalistic
irrationalistic / styles.less
Created August 28, 2016 22:44
Custom styling for vim-mode-plus status line in Atom
.vim-mode-plus-status(@color) {
color: contrast(@color);
background: @color;
border-radius: 3px;
line-height: 1em;
padding: 5px 8px;
}
atom-workspace.theme-atom-material-ui {
.status-bar-vim-mode-plus-insert {
@irrationalistic
irrationalistic / javascript.snippets
Created July 15, 2015 18:12
UltiSnips: Require Snippet for Javascript
global !p
def camel(line):
if not line: return ''
res = re.sub(r'[_-].?',lambda x: x.group()[1].upper() if len(x.group()) > 1 else '' ,line)
res = res.replace('.', '')
if not res: return ''
return res[0].lower() + res[1:]
def filename(path):
return os.path.splitext(os.path.basename(path))[0]
@irrationalistic
irrationalistic / config.js
Created March 18, 2015 00:47
Wolfram Key Protection
var config = {
wolframKey: 'my api key here'
};
module.exports = config;
" File: .vimrc
" Author: Chris Rolfs
"
" Gotta be first
set nocompatible
filetype off
set guifont=Meslo\ LG\ S\ DZ\ Regular\ for\ Powerline:h14
@irrationalistic
irrationalistic / app-focus-osx.js
Last active August 29, 2015 14:11
Hacky way to detect terminal focus for given process name (OSX)
/*
If terminal doesn't have focus, it won't execute the child process.
If it does have focus, the process will execute and then check
to see if the windows title matches your regular expression.
Only then will timeMet be set and the timeout will run
*/
var timeMet = false;
setTimeout(function(){
if(!timeMet){
startPos = own.position
endPos = [startPos[0], startPos[1] + 1, startPos[2]]
print(startPos)
print(endPos)
rayed = own.rayCast(endPos, startPos)
print(rayed)
extends layout
block content
h1 Hello Boulder!
script.
var names = !{JSON.stringify(data)};
script(src="main.js")
@irrationalistic
irrationalistic / controllerSnippet.sublime-snippet
Created August 11, 2014 19:50
Quick snippet for building new Express controller boilerplate
<snippet>
<content><![CDATA[
var ${1:my}Controller = {
${2:index}: function(req, res){
${3:// body}
}${0}
};
module.exports = ${1}Controller;
]]></content>
@irrationalistic
irrationalistic / .zshrc
Created August 11, 2014 19:29
.zshrc with vim commands
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="my"
# ZSH_THEME="zhann"
DEFAULT_USER="chris"
@irrationalistic
irrationalistic / Default (Windows).sublime-keymap
Created July 28, 2014 02:15
Vim Colemak keybindings in ST3 (windows)
[
// movement in command mode
// up
{
"keys": ["e"],
"command": "set_motion",
"args": {
"motion": "move",
"motion_args": {"by": "lines", "extend": true, "forward": false }