Skip to content

Instantly share code, notes, and snippets.

View patrickkettner's full-sized avatar

patrick kettner patrickkettner

View GitHub Profile
This file has been truncated, but you can view the full file.
//
// jsh
// Launch a window for interactively executing JavaScript commands
//
// $Id$
// Copyright: (c)2007, xbytor
// License: http://www.opensource.org/licenses/bsd-license.php
// Contact: xbytor@gmail.com
//
app;
/**package
{ "name": "modernizr",
"version": "2.8.3",
"description":"Modernizr, without the complaints" }
**/
/*!
* Modernizr v2.8.3
* www.modernizr.com
*
@patrickkettner
patrickkettner / Emulator Guide.md
Created August 23, 2013 20:56
Quick guide on settings up emulators for various mobile platforms.
function getURLOfLargestBackgroundImage() {
var _elms = new Map();
var _canidates = new Map();
const HEIGHT = document.documentElement.clientHeight * 1.4;
const WIDTH = document.documentElement.clientWidth;
const GRANULARITY_IN_PX = 10
const MIN_WIDTH = 150
const MIN_HEIGHT = 150
@patrickkettner
patrickkettner / dehumidifier.js
Last active September 23, 2019 02:10
Frigidaire.js
const Frigidaire = require('frigidaire');
const debug = require('debug')('frigidaire');
Frigidaire.prototype.DEHUMIDIFIER_MODE = 10002
Frigidaire.prototype.FAN_SPEED_ACTUAL = 10003
Frigidaire.prototype.FAN_SPEED_SETTING = 10004
Frigidaire.prototype.FILTER_STATUS = 10009
Frigidaire.prototype.FULL_BUCKET_INDICATOR = 10010
Frigidaire.prototype.HUMIDITY_SETTING = 10011
Frigidaire.prototype.HUMIDITY_ROOM = 10012
@patrickkettner
patrickkettner / gist:5189012
Created March 18, 2013 17:22
bottle (python web framework) serve nested static files
"""
I don't know why, but this took me forever to figure out.
you just need to match .* and then serve it out of a root folder
with a matching file structure to the request.
leaving this here for the next time I need to roll something from scratch
"""
@route('/static/<filename:re:.*>')
def server_static(filename):
return static_file(filename, root='./static')
function(a) {
if (!a) return 0;
var b = s_ed("div");
b.style.position = "absolute";
b.style.whiteSpace = "pre";
b.style.font = "16px arial,sans-serif";
a = s_OH(a);
s_Rc(b, a);
document.body.appendChild(b);
a = Math.round(b.offsetWidth);
SELECT REGEXP_EXTRACT(url, r'(captainicon|octicon|typicon|entypo|mfglabsiconset|ionicons|fontawesome|icomoon)') type, count(distinct(pageid)) cnt
FROM [httparchive:runs.2018_01_15_requests]
WHERE REGEXP_MATCH(url, r'captainicon|octicon|typicon|entypo|mfglabsiconset|ionicons|fontawesome|icomoon')
GROUP BY type
ORDER BY cnt desc;
@patrickkettner
patrickkettner / tufte.terminal
Last active August 4, 2017 05:06
terminal color scheme for OS X terminal, based on Monica Dinculescu (@notwaldorf) tufte theme - https://github.com/notwaldorf/.not-quite-dotfiles/blob/master/terminal-preferences/tufte.itermcolors
<?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>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECcwLjM0OTYyMDY0
MDMgMC4yODg3OTMyMzYgMC40OTE4MjgwMjQ0IDFPECcwLjI3NjkyNjc4NTcgMC4yMTQx
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<ui-pane id="middle" style="grid-template-columns: 319px 1fr 299px;" row1="" disablegridtemplates="" disablegridstartandend="" hgrid=""><ui-pane id="propertiesBar" role="section" col1="" captioned="" dockleft=""><ui-caption><span class="pane-caption-text">Properties</span><ui-close-button title="Close"><svg xmlns="http://www.w3.org/2000/svg" fill="#000000" viewBox="0 0 24 24" width="48" height="48"> <path d="M 19 6.41 L 17.59 5 L 12 10.59 L 6.41 5 L 5 6.41 L 10.59 12 L 5 17.59 L 6.41 19 L 12 13.41 L 17.59 19 L 19 17.59 L 13.41 12 Z" /> <path fill="none" d="M 0 0 h 24 v 24 H 0 Z" /> </svg></ui-close-button></ui-caption><ui-body row2=""><ui-propertygrid><ui-propertygrid-container><ui-propertygrid-table><tr><td class="firstRow" style="width: 50%;"></td><td class="firstRow"></td></tr></ui-propertygrid-table></ui-propertygrid-container><ui-propertygrid-footer style="display: none;"><span class="property-footer-title"></sp