Skip to content

Instantly share code, notes, and snippets.

@davidjgoss
davidjgoss / gist:9608808
Created March 17, 2014 21:31
Report viewport resizes (where width or height has changed by 50px or more) and orientation changes as "Viewport" events to Google Analytics, in order to find out on average how many resizes are down to orientation changes and how many are actual window resizes.
var viewportclock,
startwidth = document.documentElement.clientWidth,
startheight = document.documentElement.clientHeight,
widthchange,
heightchange;
var testResize = function() {
widthchange = startwidth - document.documentElement.clientWidth;
heightchange = startheight - document.documentElement.clientHeight;
if (widthchange > 50 || widthchange < -50) {
@davidjgoss
davidjgoss / gist:975d6036262c2d00bdc9
Created July 5, 2014 10:23
Stop WordPress filters from touching page HTML
<?php remove_filter( "the_content", "wpautop" );
remove_filter( "the_content", "wptexturize" ); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php add_filter( "the_content", "wpautop" );
@davidjgoss
davidjgoss / gist:056f4097847f377287a2
Last active August 29, 2015 14:05
Another option to deal with data tables in responsive design
<style>
.table-wrap {
width: 100%;
overflow-x: auto;
}
</style>
<div class="table-wrap">
<table>...</table>
</div>
@davidjgoss
davidjgoss / es6-training-links.md
Last active September 18, 2015 13:49
ES6 Training Links
@davidjgoss
davidjgoss / lombok-fixup.md
Created August 16, 2019 07:51
Regex to change builder usage from `.withFoo` to `.foo` for Lombok

Find:

\.with(\w{1})

Replace:

.\L$1

Keybase proof

I hereby claim:

  • I am davidjgoss on github.
  • I am davidjgoss (https://keybase.io/davidjgoss) on keybase.
  • I have a public key ASB8WRICGuqk0Bbo7sXVmGOrB6aA__-k6yN1TW1DvjOK7Ao

To claim this, I am signing this object: