Skip to content

Instantly share code, notes, and snippets.

@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
@abbotto
abbotto / arch-amd-catalyst
Last active March 8, 2023 10:54
Install Latest AMD Catalyst Video Drivers in Arch Linux
# INSTRUCTIONS
# ==============
# IMPORTANT NOTICE:
# “catalyst-test”, from AUR, contains the “latest” AMD/ATI testing/beta drivers, primarily for newer cards.
# Please note that Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
# Reference: https://aur.archlinux.org/packages/catalyst-test/
# Reference: https://wiki.archlinux.org/index.php/AMD_Catalyst
# Reference: http://www.ramblgyrl.com/2014/11/install-catalyst-drivers-on-arch-linux/
# ==============
@abbotto
abbotto / conky.conf
Last active February 23, 2021 10:42
Conky settings for Linux
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
conky.config = {
-- General settings
alignment = 'top_right',
background = true,
border_width = 1,
cpu_avg_samples = 2,
default_color = 'white',
default_outline_color = '#555',