Skip to content

Instantly share code, notes, and snippets.

View subhaze's full-sized avatar

Michael Russell subhaze

View GitHub Profile
@subhaze
subhaze / Preferences.sublime-settings
Created August 11, 2013 16:19
Sublime Text 3 Settings
{
"auto_complete_commit_on_tab": true,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin, text.haml",
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
@subhaze
subhaze / .gitignore
Last active December 26, 2015 05:59
personal, global, .gitignore for work
## Use the file below (.gitkeep) to ensure git keeps up with the directory
## - Useful if you need to ignore entire contents but keep the folder intact.
!.gitkeep
### OSX
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
<!DOCTYPE html>
<html lang="en">
<body class="container">
<h1>Some Title</h1>
<% if (names.length) { %>
<ul>
<% names.forEach(function(name){ %>
<li><%= name %></li>
@subhaze
subhaze / jquery-outsideclick.js
Created April 12, 2016 13:23
event to fire when you click outside an element
jQuery.event.special.outsideclick = {
setup: function(data, namespaces, handler){
var $this = $(this);
var namespace = namespaces.join('.');
function _clickHandler(e){
var handleClick = true;
var mouseUsed = 'button' in e;
if(namespace === 'mouse' && !mouseUsed){
handleClick = false;
@subhaze
subhaze / .site
Created April 12, 2016 14:10
command to quickly cd to a site directory, with autocomplete
site(){
cd ~/Sites/$1
}
_site()
{
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(ls ~/Sites/)" -- $cur) )
}
complete -F _site site
@subhaze
subhaze / .sublp
Created April 12, 2016 18:08
function to get completions for sublime projects available and open said project in sublime
# Sublime text project completions
function sublp(){
subl --project ~/Sites/**/${1}.sublime-project
}
_sublp()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local list=`ls -1 ~/Sites/**/*sublime-project | cut -d/ -f5`
COMPREPLY=( $(compgen -W "${list}" -- ${cur}) )
@subhaze
subhaze / RxJS Sequence Memory.markdown
Last active April 18, 2016 00:07
RxJS Sequence Memory
@subhaze
subhaze / concatAll [Array#reduce].markdown
Last active April 19, 2016 22:36
concatAll [Array#reduce]
@subhaze
subhaze / index.html
Last active April 19, 2016 23:57
pipeline [Array#reduce]
<pre style="padding: 20px"><code class="hljs js">
function pipeline(data, ...fns){
return fns.reduce((acc, curr) => curr(acc), data);
}
let abc = pipeline('a', (v)=>v+'b', (v)=>v+'c');
console.log(abc);
// "abc"
@subhaze
subhaze / flatMap [Array#reduce].markdown
Created April 22, 2016 14:25
flatMap [Array#reduce]