View reconstructor.coffee
class Toolbar
constructor: ->
document.addEventListener 'turbolinks:before-cache', @turboBeforeCache
@reConstructor()
reConstructor: ->
@registerWaypoint()
registerWaypoint: ->
View turbolinks_enquire.coffee
View turbolinks_trustpilot.coffee
View ready.js
document.addEventListener('DOMContentLoaded', function(){
console.log('DOMContentLoaded');
});
document.addEventListener('turbolinks:load', function(){
console.log('turbolinks:load');
});
jQuery(function(){
console.log('jQuery Document Ready');
View foo.rb
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<script src="..."></script>
</head>
<body>
<h1>Hello World!</h1>
<script src="..."></script>
</body>
View sam-validate.rb
#!/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')
View gitio.sh
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
}
View bm.rb
#!/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'
View lp.js
// 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;
View vcr_helper.rb
# 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