This file contains hidden or 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
enquire.turboRegister = (query, cb) -> | |
document.addEventListener 'turbolinks:load', -> enquire.register query, cb | |
document.addEventListener 'turbolinks:before-cache', -> enquire.unregister query, cb | |
enquire.register query, cb |
This file contains hidden or 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
document.addEventListener 'turbolinks:before-cache', -> | |
Trustpilot.Modules.WidgetManagement.removeWidgets() | |
document.addEventListener 'turbolinks:load', -> | |
return unless window.Trustpilot? | |
Trustpilot.Modules.WidgetManagement.findAndApplyWidgets() |
This file contains hidden or 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
document.addEventListener('DOMContentLoaded', function(){ | |
console.log('DOMContentLoaded'); | |
}); | |
document.addEventListener('turbolinks:load', function(){ | |
console.log('turbolinks:load'); | |
}); | |
jQuery(function(){ | |
console.log('jQuery Document Ready'); |
This file contains hidden or 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>My Page</title> | |
<script src="..."></script> | |
</head> | |
<body> | |
<h1>Hello World!</h1> | |
<script src="..."></script> | |
</body> |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'pp' | |
require 'json' | |
require 'yaml' | |
require 'open-uri' | |
require 'json-schema' | |
SCHEMA = begin | |
file = open('https://raw.githubusercontent.com/awslabs/goformation/master/schema/sam.schema.json') |
This file contains hidden or 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
gitio () { | |
local url=$(curl -s -i https://git.io -F "url=$1" | grep "Location: " | cut -d" " -f2) | |
echo -n $url | tr -d '\n' | pbcopy | |
echo $url | |
} |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'benchmark' | |
require 'bundler/inline' | |
gemfile true do | |
source 'https://rubygems.org' | |
gem 'activerecord-sqlserver-adapter', ENV['VER_AR'] || '~> 5.1.0' | |
gem 'tiny_tds', ENV['VER_TTDS'] || '~> 2.0.0' | |
gem 'pg' |
This file contains hidden or 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
// Assuming you put the LP init code into a function called window.lpTagCustomInit | |
document.addEventListener('turbolinks:before-cache', function(){ | |
jQuery("[id^='LP_DIV']").empty(); | |
}) | |
document.addEventListener('turbolinks:load', function(){ | |
delete window.liveperson; | |
delete window.lpMTagConfig; | |
delete window.lpTag; |
This file contains hidden or 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
# This assumes you have a client with a URL config. Hard coded URLs work too. | |
# Will automiatically insert cassets whenever needed and organize them per servcie. | |
# | |
VCR.configure do |c| | |
c.around_http_request do |request| | |
if request.uri =~ Regexp.new(MyServiceClient.config.url) | |
VCR.use_cassette 'my_service', default_cassette_options, &request | |
else | |
request.proceed | |
end |
This file contains hidden or 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
class Foo | |
attr_reader :bar | |
def initialize | |
@bar = 'bar' | |
end | |
end | |
module Bar | |
def bar | |
super.upcase |