Skip to content

Instantly share code, notes, and snippets.

View TexRx's full-sized avatar
🏠
Working from home

Bobbie Tables TexRx

🏠
Working from home
  • Austin, TX
View GitHub Profile
@TexRx
TexRx / diffmerge-diff.sh
Created April 29, 2014 22:37 — forked from featheredtoast/diffmerge-diff.sh
DiffMerge configuration for git
#!/bin/sh
# Use SourceGear DiffMerge as mergetool for git in cygwin.
# git config --global mergetool.diffmerge.cmd "diffmergetool.sh \"\$LOCAL\" \"\$REMOTE\" \"\$BASE\" \"\$MERGED\""
# git config --global mergetool.diffmerge.trustExitCode false
# git difftool -t diffmerge branch1..branch2
# Reference: http://www.tldp.org/LDP/abs/abs-guide.pdf
library=githelperfunctions.sh
@TexRx
TexRx / gist:11294961
Created April 25, 2014 16:16
Hugo Giraudel Sass Resource List
@TexRx
TexRx / Gulpfile.js
Created April 22, 2014 03:26 — forked from webdesserts/Gulpfile.js
Gulp + Node server task example
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@TexRx
TexRx / .jshintrc.js
Created April 18, 2014 04:16 — forked from connor/.jshintrc.js
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
function onlyStatic (middleware) {
return function (req, res, next) {
var match = /(\.css|\.eot|\.gif|\.html|\.js|\.png|\.svg|\.ttf|\.woff)($|\?.*$)/ig.exec(req.originalUrl);
if (!match) return next();
middleware(req, res, next);
};
}
//usage
this.use(onlyStatic(express.static(__dirname + "/public")));
@TexRx
TexRx / disable_pointer_events.js
Created March 20, 2014 08:08
pointer events disable scroll 60 fps
/**
* Disable and enable event on scroll begin and scroll end.
* @see http://www.thecssninja.com/javascript/pointer-events-60fps
*/
var root = document.documentElement;
var timer;
window.addEventListener('scroll', function() {
// User scrolling so stop the timeout
clearTimeout(timer);
# Execute this in Nuget powershell console
get-project -all | %{ $_.Properties | ?{ $_.Name -eq "WebApplication.StartWebServerOnDebug"} | %{ $_.Value = $False } }
// Updated requestAnimationFrame polyfill that uses new high-resolution timestamp
//
// References:
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// https://gist.github.com/1579671
// http://updates.html5rocks.com/2012/05/requestAnimationFrame-API-now-with-sub-millisecond-precision
//
// Note: this is my initial stab at it, *requires additional testing*
(function () {