Skip to content

Instantly share code, notes, and snippets.

@heymatthew
heymatthew / .vimrc
Last active December 27, 2015 01:19
vimrc
" .vimrc configuration file
" Copyright (C) 2013 Matthew B. Gray
"
" Permission is granted to copy, distribute and/or modify this document
" under the terms of the GNU Free Documentation License, Version 1.3
" or any later version published by the Free Software Foundation;
" with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
" A copy of the license is included in the section entitled "GNU
" Free Documentation License".
To get Git to diff between your odt/odp/ods files you will need to do the following things:
Install a conversion tool
$ sudo yum install odt2txt
Create your git config info directory if it's not already there
$ mkdir -p ~/.config/git/info
Add in attributes (you can paste this straight in or edit the file accordingly)
$ cat > ~/.config/git/info/attributes <<DELIM
@heymatthew
heymatthew / gist:5700996
Created June 3, 2013 20:13
A working samba config.
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
[alias]
co = checkout
br = branch
sb = show-branch --current --color
ci = commit -v
hist = log --pretty=format:\"%C(cyan)%h%Creset %Cgreen%ad%Creset | %C(yellow)%s%d%Creset [%C(white)%an%Creset]\" --graph --date=short
who = shortlog -s --
dump = cat-file -p
ri = rebase --interactive
smf = submodule foreach git fetch --all
@heymatthew
heymatthew / gist:5282912
Created April 1, 2013 02:26
Testing then statement in the Q framework to assert then() return's a wrapped promise callback. "Give me a callback for this promise and I'll give you a promise that represents the result of that callback."
(function() {
q = require('q');
var one,two,three;
function asyncOne() {
console.log('one called');
var allDone = q.defer();
setTimeout(allDone.resolve, 1000);
return allDone.promise;
}
@heymatthew
heymatthew / so-many-promises.js
Created August 20, 2012 21:07
Chaining Promises with JQuery in Javascript
// Prereq: underscore.js and jquery loaded
var p1 = $.Deferred();
var p2 = $.Deferred();
// We want something that chains promises, so something like...
//p1.done(
// function addNext() {
// p2.done(
// function addNext() {