Skip to content

Instantly share code, notes, and snippets.

View gridwalk's full-sized avatar

Don Hanson gridwalk

View GitHub Profile
@gridwalk
gridwalk / websplicer.js
Last active October 30, 2018 09:36
WebSplicer Bookmarklet
var ajax = {};
ajax.x = function () {
if (typeof XMLHttpRequest !== 'undefined') {
return new XMLHttpRequest();
}
var versions = [
"MSXML2.XmlHttp.6.0",
"MSXML2.XmlHttp.5.0",
"MSXML2.XmlHttp.4.0",
"MSXML2.XmlHttp.3.0",
@gridwalk
gridwalk / gist:cb0228af9885485dff0a
Created February 10, 2016 05:25
Remove Comments from Wordpress Export File with Regex
<wp:comment>(.|\n)*?<\/wp:comment>
@gridwalk
gridwalk / css_scrambler.js
Created December 23, 2015 22:07
CSS Scrambler is a bookmarklet that reads the HTML from top to bottom and shifts the CSS rules from each element onto its preceding element. The result is a scrambled layout. It can be run multiple times on a page!
// the css rules that we want to copy
var all_styles = ["background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopStyle","borderTopWidth","borderWidth","borderImage","borderRadius","bottom","boxShadow","captionSide","clear","clip","color","content","cssFloat","cursor","direction","display","fill","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBottom","marginLeft","marginRight","marginTop","maxHeight","maxWidth","minHeight","minWidth","opacity","outline","outlineC
// This function is for including static HTML in a NWJS page. (Node Webkit)
// usage: <script>include('header.html');</script>
var include = function(file){
html = fs.readFileSync(file)
scripts = document.getElementsByTagName('script');
lastScript = scripts[scripts.length-1];
lastScript.insertAdjacentHTML("beforebegin", html);
}
@gridwalk
gridwalk / gist:8678274
Last active January 4, 2016 20:59
CSS Hack for making borders any size
//produces a 100px box with 80px right border
div{
height: 100px;
position:relative;
&:after {
content: '';
position: absolute;
height: 80%;
border-right: 2px solid red;
@gridwalk
gridwalk / gist:8660141
Last active January 4, 2016 18:19
Reinitialize player on rotate
//Automatic resize video player on device rotate
$(document).on('resize',function(){
$player = $('.videoplayer iframe')
$player.attr('src', $player.attr('src'));
});
@gridwalk
gridwalk / MIDI JS Template
Created December 8, 2013 07:13
This is a simple template for processing MIDI events with JavaScript, using the Jazz Plugin.
<!--
MIDI JS Template for use with the Jazz plugin.
Google Jazz browser plugin and install it.
You also need a USB MIDI controller to use this.
-->
<html>