Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / blob.support.js
Created September 14, 2015 03:40
Basic Blob Fallback Support
var __support = {
// Blob
Blob: !!window.Blob,
BlobSlice: !!Blob.prototype.slice,
URL: !!window.URL,
}
var prefixes = ['webkit', 'Webkit', 'WebKit', 'moz', 'Moz', 'o', 'O', 'ms', 'Ms', 'MS', 'khtml', 'Khtml', ''];
// Number of prefixes
var i = prefixes.length;
@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 / blob.fallback.js
Created September 13, 2015 07:11
Simple BlobBuilder fallback for Blob
// Simple BlobBuilder fallback for Blob
if(!__support.Blob) {
// BlobBuilder fallback for Blob
(function(blob) {
blob = function(data, obj) {
var n;
// Fallback for BlobBuilder
while ((i -= 1) > -1) {
window.BlobBuilder = window.BlobBuilder || window[prefixes[i] + 'BlobBuilder'];
@abbotto
abbotto / preprocessor_fun.h
Last active September 11, 2015 17:26 — forked from aras-p/preprocessor_fun.h
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@abbotto
abbotto / bashrc.antergos.sh
Created September 4, 2015 23:37
.bashrc file for antergos
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
@abbotto
abbotto / antergos.chroot.sh
Created September 4, 2015 01:32
CHROOT Antergos
sudo mkdir /mnt/arch && sudo mount /dev/sda5 /mnt/arch && sudo arch-chroot /mnt/arch /usr/bin/mkinitcpio -p linux && cd /mnt/arch && sudo mount -t proc proc proc/ && sudo mount --rbind /sys sys/ && sudo mount --rbind /dev dev/
@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 / polyfill.insertAdjacentHTML.js
Last active April 27, 2018 08:39
polyfill.insertAdjacentHTML.js
/*!
* polyfill.insertAdjacentHTML.js
* Author: Jared Abbott
* Description: A Cross-browser implementation of HTMLElement.insertAdjacentHTML
* Copyright 2015 Jared Abbott
* Distributed under the MIT license
*/
if (!("insertAdjacentHTML" in document.createElementNS("http://www.w3.org/1999/xhtml", "_"))) {
HTMLElement.prototype.insertAdjacentHTML = function(position, html) {