Skip to content

Instantly share code, notes, and snippets.

@coldhawaiian
coldhawaiian / DiffMergeToolConfigs.md
Last active December 19, 2015 07:29
Diff and Merge Tool Configurations

MsysGit

Add to your user .gitconfig file (use tabs for indents). Paths are for MsysGit, and may not work in Cygwin:

# Default tools
[merge]
    tool = bc3
[diff]
	tool = bc3
# Beyond Compare
[difftool "bc3"]
#!bash.exe
export SSH_AUTH_SOCK=/tmp/.ssh-socket
echo ;
echo Starting connection with ssh-agent...
ssh-add -l 2>&1 >/dev/null
if [ $? = 2 ]; then
rm -f /tmp/.ssh-script /tmp/.ssh-agent-pid /tmp/.ssh-socket
# Exit status 2 means couldn't connect to ssh-agent; start one now
echo Creating new ssh-agent...
ssh-agent -a $SSH_AUTH_SOCK > /tmp/.ssh-script
using System;
using System.Collections.Specialized;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Moq;
/// <summary>
/// This helper class can be used to set up Moq mocks of MVC3 controllers.
/// Slightly modified from the original version from Scott Hanselman's blog:

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

#include <stdio.h>
int f0(unsigned int x) { return x? (x&(1<<31)? f1(x<<1) : f0(x<<1)) : 1; }
int f1(unsigned int x) { return x? (x&(1<<31)? f3(x<<1) : f2(x<<1)) : 0; }
int f2(unsigned int x) { return x? (x&(1<<31)? f0(x<<1) : f4(x<<1)) : 0; }
int f3(unsigned int x) { return x? (x&(1<<31)? f2(x<<1) : f1(x<<1)) : 0; }
int f4(unsigned int x) { return x? (x&(1<<31)? f4(x<<1) : f3(x<<1)) : 0; }
int t0(unsigned int x) { return x? (x&(1<<31)? t1(x<<1) : t0(x<<1)) : 1; }
int t1(unsigned int x) { return x? (x&(1<<31)? t0(x<<1) : t2(x<<1)) : 0; }
int t2(unsigned int x) { return x? (x&(1<<31)? t2(x<<1) : t1(x<<1)) : 0; }
@coldhawaiian
coldhawaiian / Preferences.sublime-settings
Created January 5, 2014 08:17
Sublime Text 3 User Preferences
{
"auto_indent": true,
"bold_folder_labels": true,
// https://github.com/thinkpixellab/flatland
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"font_face": "Source Code Pro",
"font_size": 14,
"highlight_modified_tabs": true,
"rulers":
[
/*global requirejs*/
requirejs.config({
shim: {
"bootstrap/js/bootstrap-affix": ["jquery"],
"bootstrap/js/bootstrap-transition": ["bootstrap/js/bootstrap-affix"],
"bootstrap/js/bootstrap-alert": ["bootstrap/js/bootstrap-transition"],
"bootstrap/js/bootstrap-button": ["bootstrap/js/bootstrap-alert"],
"bootstrap/js/bootstrap-collapse": ["bootstrap/js/bootstrap-button"],
"bootstrap/js/bootstrap-dropdown": ["bootstrap/js/bootstrap-collapse"],
"bootstrap/js/bootstrap-modal": ["bootstrap/js/bootstrap-dropdown"],
// Facebook SDK
angular.module('facebook', [])
.directive('fb', ['$FB', function($FB) {
return {
restrict: "E",
replace: true,
template: "<div id='fb-root'></div>",
compile: function(tElem, tAttrs) {
return {
post: function(scope, iElem, iAttrs, controller) {
@coldhawaiian
coldhawaiian / notes.md
Last active January 4, 2016 20:49
AngularJS Scope Notes

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt