This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isAutoplaySupported = function (callback) { | |
var timeout; | |
var waitTime = 200; | |
var retries = 5; | |
var currentTry = 0; | |
var elem = document.createElement('video'); | |
var elemStyle = elem.style; | |
function testAutoplay(arg) { | |
currentTry++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Stripe.applePay.checkAvailability = function (callback) { | |
if (location.protocol === 'https:') { | |
var canMakePayments = window.ApplePaySession && ApplePaySession.canMakePayments() | |
if (/^pk_test_/.test(Stripe.key || Stripe.publishableKey)) { | |
callback(canMakePayments) | |
} else if (canMakePayments) { | |
var merchantId = "merchant." + window.location.hostname + ".stripe" | |
ApplePaySession.canMakePaymentsWithActiveCard(merchantId).then(callback) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function ($) { | |
var wasTapped = function wasTapped (element) { | |
var touchStart = element.data('lastTouchStart') | |
var touchEnd = element.data('lastTouchEnd') | |
return ( | |
touchStart && touchEnd && | |
touchEnd.timeStamp - touchStart.timeStamp <= 500 && // duration | |
Math.abs(touchEnd.pageX - touchStart.pageX) <= 10 && // deltaX | |
Math.abs(touchEnd.pageY - touchStart.pageY) <= 10 // deltaY | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>LinkToBug</title> | |
<link data-turbolinks-track="true" href="/assets/application.css?body=1" media="all" rel="stylesheet" /> | |
<link data-turbolinks-track="true" href="/assets/bug.css?body=1" media="all" rel="stylesheet" /> | |
<script data-turbolinks-track="true" src="/assets/jquery.js?body=1"></script> | |
<script data-turbolinks-track="true" src="/assets/jquery_ujs.js?body=1"></script> | |
<script data-turbolinks-track="true" src="/assets/turbolinks.js?body=1"></script> | |
<script data-turbolinks-track="true" src="/assets/bug.js?body=1"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form.awesome { | |
// Defaults for custom inputs | |
.custom { | |
display: inline-block; | |
width: 16px; | |
height: 16px; | |
position: relative; | |
top: 2px; | |
border: solid 1px $custom-form-border-color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'active_record' | |
# Print out what version we're running | |
puts "Active Record #{ActiveRecord::VERSION::STRING}" | |
# Connect to an in-memory sqlite3 database | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => ':memory:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'active_record' | |
# Print out what version we're running | |
puts "Active Record #{ActiveRecord::VERSION::STRING}" | |
# Connect to an in-memory sqlite3 database | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'sqlite3', | |
:database => ':memory:' |