Skip to content

Instantly share code, notes, and snippets.

View mitzerh's full-sized avatar

Helcon Mabesa mitzerh

View GitHub Profile
@mitzerh
mitzerh / viewport.js
Created February 18, 2015 02:52
Check if DOM is visible in viewport
function isElementInViewport (el) {
//special bonus for those using jQuery
if (typeof jQuery === "function" && el instanceof jQuery) {
el = el[0];
}
var rect = el.getBoundingClientRect();
return (
@mitzerh
mitzerh / fiddle.css
Created February 18, 2015 14:28
Infinitely Loading Content
.highlight { border: 2px solid red; }
@mitzerh
mitzerh / diffwrap.sh
Created March 27, 2015 19:31
SVN Diff
#!/bin/sh
# Configure your favorite diff program here.
#DIFF="/usr/bin/vimdiff"
DIFF="/usr/bin/opendiff"
# Subversion provides the paths we need as the sixth and seventh
# parameters.
LEFT=${6}
RIGHT=${7}