Skip to content

Instantly share code, notes, and snippets.

View shaun-stripe's full-sized avatar

Shaun Williams shaun-stripe

  • Stripe
  • Houston
View GitHub Profile
@shaun-stripe
shaun-stripe / sfsvc.md
Last active January 18, 2017 17:37
Safari View Controller - `window.open` bug

Problem

window.open behaves differently inside the following iOS browsers:

  • Mobile Safari - window.open opens a new tab
  • Safari View Controller - window.open redirects current page

Consequences

  • Non-standard: Safari View Controller adds a non-standard step to the WHATWG spec, by overriding the desired target browser context to "_self", rather than going through the standard sandboxing for restricting tab navigation, or simply returning null as described at the end of item 4.
@shaun-stripe
shaun-stripe / reading-clojure.md
Created September 21, 2016 21:10
Reading Clojure

Reading Clojure in 5 minutes

Syntax

There is literal data:

; number
1.23
@shaun-stripe
shaun-stripe / readme.md
Created May 27, 2016 22:49
texas flag emoji for Slack
/* in http://example.com/viewport.css */
/* 'elementID' must be changed to your desired isolated element ID */
html.mvc__a.mvc__lot.mvc__of.mvc__classes.mvc__to.mvc__increase.mvc__the.mvc__odds.mvc__of.mvc__winning.mvc__specificity,
html.mvc__a.mvc__lot.mvc__of.mvc__classes.mvc__to.mvc__increase.mvc__the.mvc__odds.mvc__of.mvc__winning.mvc__specificity > body {
background: #fff;
width: auto;
min-width: inherit;
max-width: inherit;
height: auto;
min-height: inherit;
AuthenticationService.prototype.applyStyles = function (iframe) {
  iframe.style.position = 'fixed';
  iframe.style.top = '0';
  iframe.style.left = '0';
  iframe.style.height = '100%';
  iframe.style.width = '100%';
  iframe.setAttribute('frameborder', '0');
 iframe.setAttribute('allowTransparency', 'true');
@shaun-stripe
shaun-stripe / js-gotchas.md
Last active March 31, 2016 21:58
JS gotchas

Shorthand anonymous functions

JS allows you to create shorthand anonymous functions, but it gets confused if you're trying to return an Object.

(a,b) => a+b
(a,b) => {sum: a+b}  // cannot return an Object like this, because curlies mean body
(a,b) => { let sum = a+b; return sum; }