Skip to content

Instantly share code, notes, and snippets.

View abbotto's full-sized avatar

Jared Abbott abbotto

  • Newfoundland & Labrador
View GitHub Profile
@abbotto
abbotto / jQuery PNG Fix for IE6 Background Images
Last active August 25, 2026 00:32
Super Simple jQuery PNG Fix for IE6 background images
/*
Works best for background images with set dimensions
Just add a ".pngfix" class to anything you want fixed
or put in some other jQuery selector.
*/
$('.pngfix').each( function() {
$(this).attr('writing-mode', 'tb-rl');
$(this).css('background-image', 'none');
$(this).css( 'filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="path/to/image.png",sizingMethod="scale")');
});
@abbotto
abbotto / Snipplr-64564.txt
Created August 16, 2013 12:56
IP Blacklist Check Script
<html>
<head>
<title>DNSBL Lookup Tool - IP Blacklist Check Script</title>
</head>
<body>
<form action="" method="get">
<input type="text" value="" name="ip" />
<input type="submit" value="LOOKUP" />
</form>
<?php
@abbotto
abbotto / viewBlob.js
Created September 13, 2015 07:19
Open a blob in a browser tab
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
xhr.onload = function(e) {
if (this.status == 200) {
// Return the blob and set the contentType
// Note: .response instead of .responseText
var _viewBlob = function(data, contentType) {
var file = new Blob([data], {
type: contentType
@abbotto
abbotto / config.xml
Created October 11, 2014 18:57
Modified UnleashX config.xml for Xbox
<?xml version="1.0" encoding="utf-8"?>
<UnleashX>
<Settings>
<MSDashBoard>C:\Xb0xdash.xbe</MSDashBoard>
<Password MaxTries="3"></Password>
<Network Enable="Yes" Type="DHCP">
<IP>192.168.1.250</IP>
<Subnet>255.255.255.0</Subnet>
<Gateway>192.168.1.254</Gateway>
<DNS1>192.168.1.254</DNS1>
@abbotto
abbotto / getComputedStyle.js
Created January 23, 2015 20:27
getComputedStyle Polyfill
if (!window.getComputedStyle) {
/**
* @param {(Element|null)} e
* @param {(null|string)=} t
* @return {(CSSStyleDeclaration|null)}
*/
window.getComputedStyle = function(e, t) {
return this.el = e, this.getPropertyValue = function(t) {
/** @type {RegExp} */
var n = /(\-([a-z]){1})/g;
@abbotto
abbotto / jss.js
Last active April 26, 2024 08:15
JavaScript StyleSheets
/**
* JSS
* Author: Jared Abbott
* Copyright 2015 Jared Abbott
* Distributed under the MIT license
*
* @param {Object}
*/
var _jss = function(jss, combinator) {
var _toString = Function.prototype.call.bind(Object.prototype.toString);
@abbotto
abbotto / xhrBinary.js
Last active April 26, 2024 08:13
Get binary data with XHR in most browsers including IE8+
/*!
* xhrBinary.js
* Author: Jared Abbott
* Copyright 2015 Jared Abbott
* Distributed under the MIT license
*/
var xhrBinary = function(url, fn) {
// RESOURCES
// http://mgran.blogspot.com/2006/08/downloading-binary-streams-with.html
@abbotto
abbotto / nano-template.js
Last active April 26, 2024 08:13
A templating solution implemented in JavaScript [207 bytes minified+gzipped]
// Author: Jared Abbott
// Created: December 2015
// License: MIT
var template = function(tpl, data) {
// Make sure the cache is available
var w = window;
w.tplCache = !w.tplCache ? {} : w.tplCache;
// Prepare and load the template
tpl = ('"' + tpl.replace(/\{\{(.*?)\}\}/g, '"+$1+"') + '"').split(/\'+ | + \'/);
@abbotto
abbotto / terminus.theme.bash
Created June 21, 2018 20:44
Terminus Them for Bash-it
#!/usr/bin/env bash
SCM_THEME_PROMPT_DIRTY=" ${red}✗"
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓"
SCM_THEME_PROMPT_PREFIX=" ${green}"
SCM_THEME_PROMPT_SUFFIX="${green}"
GIT_THEME_PROMPT_DIRTY=" ${red}✗"
GIT_THEME_PROMPT_CLEAN=" ${bold_green}✓"
GIT_THEME_PROMPT_PREFIX=" ${green}"
@abbotto
abbotto / fallout.cfg
Last active May 9, 2023 04:32
Configuration file for the original Fallout PC game
[debug]
mode=environment
output_map_data_info=0
show_load_info=0
show_script_messages=0
show_tile_num=0
[preferences]
brightness=1.000000
combat_difficulty=1