Skip to content

Instantly share code, notes, and snippets.

@wizard04wsu
wizard04wsu / dimensions.js
Created February 7, 2014 21:02
JavaScript functions to get dimensions of objects and to set scroll positions
//getDimensions([elem])
//setScrollPosition(elem, top, left)
(function (){
"use strict";
//**********************//
//***** Dimensions *****//
//**********************//
@wizard04wsu
wizard04wsu / notifications.js
Created February 12, 2014 19:49
Cross-browser desktop notifications (for supporting browsers)
//http://www.w3.org/TR/notifications/
//https://developer.mozilla.org/en-US/docs/Web/API/notification
//Notifier.isSupported
//
//Notifier.permission //"granted", "denied", or "default"
//
//Notifier.requestPermission([callback]) //first argument of callback is the current permission
//
//Notifier.notify(title[, options])
@wizard04wsu
wizard04wsu / log.htm
Last active August 29, 2015 13:56
Template for an on-page JavaScript log
<html>
<head>
<title>Log</title>
<style type="text/css" media="all">
#log {
padding:0.5em;
overflow:auto;
font-family:"Envy Code R", "Consolas", "DejaVu Sans Mono", "Anonymous Pro", "Courier New", monospace;
@wizard04wsu
wizard04wsu / _master stylesheet
Last active August 29, 2015 13:56
Master stylesheet
This is a complete stylesheet for everything in HTML 4.01, including some useful classes -- not really for use on a website, but a good reference.
<!--master styles-->
<link rel="stylesheet" type="text/css" media="all" href="css/master_main.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/master_classes.css" />
<!--[if IE]><link rel="stylesheet" type="text/css" media="all" href="css/master_IE.css" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" media="all" href="css/master_IE6.css" /><![endif]-->
@wizard04wsu
wizard04wsu / _IE 6 PNG fix
Created February 19, 2014 15:03
IE 6 PNG fix
This fixes the transparency of PNG images in IE 6, for both image elements and background image styles.
This also requires a 1-pixel transparent GIF "blank.gif" in the same directory as "iepngfix.htc".
Put the HTML below into <head>, make sure the path to "iepngfix.htc" is correct, and apply it to specific elements instead of everything.
<!--[if lte IE 6]>
<style type="text/css" media="all">
* { behavior:url(/css/iepngfix.htc); } /*IE 6 PNG fix*/
</style>
@wizard04wsu
wizard04wsu / require.js
Last active August 29, 2015 13:56
Execute a callback once required scripts have been loaded.
//require(scriptList, onSuccess[, onFailure])
//usage:
//require(["a.js", "b.js"], function (){ /*scripts have loaded; do stuff*/ }, function (){ /*one or more scripts didn't load; handle error*/ });
//
//scriptList can just be a string if there's only one script
var require = (function (){
var head = document.getElementsByTagName("head")[0];
#!/bin/bash
# 1
wget -qO root.zone http://www.internic.net/domain/root.zone
# 2
cat root.zone | grep "IN\sNS" | awk '{print $1}' | uniq | sort | sed -r 's/\.//g' | sed '/^$/d' > zone.list 2> /dev/null
# 3
@wizard04wsu
wizard04wsu / Loader.css
Created March 13, 2014 17:46
CSS3 Loading Icon/Spinner
.load {
height:100px;
width:100px;
margin:0 auto;
position:relative;
-webkit-animation: rotation 1s infinite linear;
-moz-animation: rotation .6s infinite linear;
-o-animation: rotation .6s infinite linear;
animation: rotation .6s infinite linear;
border:6px solid rgba(236,30,39,.25);
@wizard04wsu
wizard04wsu / bookmarklet.css
Last active July 1, 2020 17:53
CSS styling for bookmarklet links ( Updated version here: https://gist.github.com/wizard04wsu/a22bb88dcafb5229320e0e02ba08ef73 )
/* just add either class .peel-br or .peel-tr to your bookmarklet link */
a.peel-br, a.peel-tr {
display:inline-block;
position:relative;
padding:0.4em 0.6em;
border:1px solid #B4B4B4;
border-radius:5px;
background-color:#E6E6E6;
color:#333;
@wizard04wsu
wizard04wsu / modalDialog.css
Last active November 13, 2024 19:02
This script (and CSS stylesheet) allows you to create a custom modal dialog box that will not allow the user to interact with the rest of the page.
.modalMask {
display:none;
}
.modalMask.active {
display:block;
position:fixed;
top:0;
left:0;
bottom:0;
right:0;