Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / activetable.js
Last active January 10, 2018 16:05 — forked from stevesouders/activetable.js
ActiveTable is a bookmarklet that makes any table sortable. It also allows you to remove columns, and it remembers the removed columns for next time. Use alt+click to UNhide all columns (and clear memory). To use it, create a bookmark called "ActiveTable" that has this URL: javascript:(function(){ var jselem=document.createElement('SCRIPT'); jse…
// ActiveTable - a bookmarklet to make tables sortable and editable
function init() {
var aHrows = getHrows();
var numHrows = aHrows.length;
var aHidden = getHiddenColumns();
ATpopup = document.createElement("div");
ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;";
ATpopup.innerHTML = "<a href='sort' title='sort' onclick='sortColumn(); return false'><img border=0 src='http://stevesouders.com/images/sort_up_down.png' style='padding-top: 0.2em;'></a><br><a href='hide' style='color: #C00; font-family: monospace; font-size: 1.5em; text-decoration: none;' title='hide' onclick='hideColumn(); return false'>x</a>"; // TODO - use protocol-less URL for img
@subtleGradient
subtleGradient / Info.plist
Last active November 28, 2022 02:54
Add support for the BCM20702A0 USB Bluetooth dongle by editing /System/Library/Extensions/IOBluetoothFamily.kext/Contents/PlugIns/BroadcomBluetoothHostControllerUSBTransport.kext/Contents/Info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>16B2657</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>BroadcomBluetoothHostControllerUSBTransport</string>
@subtleGradient
subtleGradient / load.js
Created October 21, 2017 02:31
Dynamic script loading code from 2011
function load(URL){ var scr, script
;(scr = document.createElement('script')).src = URL
;(script = document.getElementsByTagName('script')[0]).parentNode.insertBefore(scr, script)
}
@subtleGradient
subtleGradient / SheetMixinDemo.html
Last active September 6, 2018 19:37
Sheet Mixin Demo. Shows how to use spreadable mixins to do some wacky behavior sheets stuff with React
<!doctype html>
<meta charset=utf-8>
<title>HasSheetsMixin</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.11.0/es6-shim.min.js"></script>
<script src="http://fb.me/react-with-addons-0.11.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.1.js"></script>
<div id="SheetsDemoRoot"></div>
@subtleGradient
subtleGradient / Google Sheets Duration functions.gs.js
Last active October 13, 2017 19:30
Custom functions for Google Sheets Duration and time calculations Raw
/**
* Copyright 2017 Thomas Aylott
* MIT License
* https://gist.github.com/subtleGradient/38bc20750bed84d0afc5ff9704379c58
*/
function showError(message){
var ui = SpreadsheetApp.getUi();
ui.alert(message);
}
<!doctype html>
<meta charset=utf-8>
<title></title>
<style>html{font-family:Helvetica Neue,Helvetica,sans-serif;}</style>
<div id=RenderTarget>
<h1>Loading…</h1>
</div>
<script type="text/babel">
@subtleGradient
subtleGradient / dabblet.css
Last active August 29, 2015 14:08 — forked from anonymous/dabblet.css
SixteenColors Prototype
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@subtleGradient
subtleGradient / async-callstack-hack.js
Created August 30, 2014 03:49
Async callstacks for your own custom event system or RPC or whatever
/**
* Created by Thomas Aylott on 2014-08-29
* Copyright 2014 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@subtleGradient
subtleGradient / index.js
Created May 27, 2014 02:25
requirebin sketch
// example using the raf module from npm. try changing some values!
var requestAnimationFrame = require("raf")
var canvas = document.createElement("canvas")
canvas.width = 500
canvas.height = 500
document.body.appendChild(canvas)
var context = canvas.getContext("2d")
var $ = require('NodObjC');
module.exports = function(props){
var NSUserNotificationCenterDelegate = $.NSObject.extend('NSUserNotificationCenterDelegate');
NSUserNotificationCenterDelegate.addMethod('init', { retval: '@', args: ['@', ':'] }, function(self) {
$.NSUserNotificationCenter('defaultUserNotificationCenter')('setDelegate', self);
return self;
});