Skip to content

Instantly share code, notes, and snippets.

View patrickkettner's full-sized avatar

patrick kettner patrickkettner

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
height: 100vh;
width: 100vw;

release modernizr in 10 easy steps

  1. compare HEAD with most recent release to determine new semver level (fundemental/breaking changes = bump major, new feature-detects/publically-exposed-util = bump minor, update to existing code (in non behavior changing way) = bump patch). Github compare view is handy here (e.g. https://github.com/Modernizr/Modernizr/compare/v3.3.1...master)
  2. update package.json version to new semver version
  3. run git tag ${semver} (e.g. git tag v3.4.0), then push the tags (git push --tags)
  4. npm publish
  5. log into the modernizr.com server
  6. cd ~/modernizr-neue
  7. npm update && bower update
  8. npm run deploy
  9. pm2 restart 0
#Block the APNIC range of IP addresses - a common source of hacking attempts
sudo ipfw -q add deny src-ip 43.0.0.0/8
sudo ipfw -q add deny src-ip 58.0.0.0/8
sudo ipfw -q add deny src-ip 59.0.0.0/8
sudo ipfw -q add deny src-ip 60.0.0.0/8
sudo ipfw -q add deny src-ip 61.0.0.0/8
sudo ipfw -q add deny src-ip 110.0.0.0/8
sudo ipfw -q add deny src-ip 111.0.0.0/8
sudo ipfw -q add deny src-ip 112.0.0.0/8
+-o AppleSmartBattery <class AppleSmartBattery, id 0x100000257, registered, matched, active, busy 0 (0 ms), retain 6>
{
"ExternalConnected" = No
"TimeRemaining" = 73
"InstantTimeToEmpty" = 17
"ExternalChargeCapable" = No
"FullPathUpdated" = 1493188334
"CellVoltage" = (3475,3520,3516,0)
"Voltage" = 10511
"BatteryInvalidWakeSeconds" = 30
@patrickkettner
patrickkettner / index.html
Last active February 15, 2017 09:24
Chrome Bug(?)
<!DOCTYPE HTML>
<html>
<head>
<title>Chrome Bug?</title>
<script>
function A() {
"use strict";
B();
}
@patrickkettner
patrickkettner / Gemfile
Last active January 23, 2017 20:41
opal bug #1581
source 'https://rubygems.org'
gem "temple", "0.6.5"
gem "opal"
Gem::Specification.new do |gem|
gem.name = 'OLD_RUBY_CGI_ESCAPE'
gem.version = '1.0.0'
gem.date = Date.today.to_s
gem.summary = "pure ruby HTML escaping extracted from the CGI module from Ruby <= 2.4"
gem.description = "extended description"
gem.authors = ['Nobuyoshi Nakada', 'Eric Hodel', 'Yui NARUSE', 'Kenta Murata', 'Zachary Scott', 'Patrick Kettner']
gem.email = 'patrickkettner@gmail.com'
var browserslist = require('browserslist');
var request = require('sync-request');
var res = request('GET', 'https://saucelabs.com/rest/v1/info/browsers/webdriver');
function lookup(requestedBrowsers, cb) {
var result = {};
var sauce = JSON.parse(res.getBody().toString())
//console.log(sauce);
// grab a reference to all scripts on the page, keep in mind this
// will only include all of the <script> elements that have been
// parsed up until this point
var scripts = document.getElementsByTagName('script');
// cheat and use currentScript if it exists, otherwise grab the last
// script tag, which will be the current running script tag sense the
// getElements call can't see nodes in the future
var currentScript = document.currentScript || scripts[scripts.length - 1];
http://codepen.io/patrickkettner/pen/pEzXEy