Skip to content

Instantly share code, notes, and snippets.

View rrrnld's full-sized avatar

rrrnld

View GitHub Profile
@rrrnld
rrrnld / overflow-cause-finder.js
Last active August 29, 2015 14:11
Find elements too wide for a viewport, causing horizontal scrollbars (jQuery necessary)
(function ($) {
var bodyWidth = $(document.body).outerWidth();
var $elems = $('body *').filter(function () {
var $this = $(this)
return $this.offset().left + $this.outerWidth(true) - parseInt($this.css('margin-left'), 10) > bodyWidth
})
if ($elems.length)
console.log($elems)
else
@rrrnld
rrrnld / bower.json
Last active August 29, 2015 13:56
Basic setup for using Curl.js to load commonjs modules; useful for testing modules written for browserify. Used modules can be installed with `bower install`
{
"name": "Curljs cjsm11 setup",
"private": true,
"dependencies": {
"chai": "~1.8.0",
"mocha": "~1.14.0",
"curl": "~0.8.8",
"backbone": "~1.1.0",
"zepto": "~1.1.2",
"lodash": "~2.4.1"