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
module GtmHelper | |
GTM_SCRIPT = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':" \ | |
"new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0]," \ | |
"j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=" \ | |
"'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);" \ | |
"})(window,document,'script','dataLayer','%s');".freeze | |
GTM_IFRAME_URL = "https://www.googletagmanager.com/ns.html?id=%s".freeze | |
def gtm_key = @gtm_key ||= Rails.application.config_for(:gtm)["key"] || "SET_GTM_KEY" | |
def render_gtm_head = tag.script(GTM_SCRIPT % gtm_key, escape: false) |
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
#!/bin/bash | |
REPO="yapr/taskhub" | |
temp_file=$(mktemp) | |
gh issue list --repo "$REPO" --state open > "$temp_file" | |
random_issue=$(shuf -n 1 "$temp_file") | |
rm "$temp_file" | |
issue_number=$(echo "$random_issue" | awk '{print $1}') | |
gh issue view "$issue_number" --repo "$REPO" --web |
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).one 'turbolinks:load', -> | |
if document.documentElement.hasAttribute('data-turbolinks-preview') | |
return | |
headers = {} | |
csrfTokenElement = document.querySelector('meta[name="csrf-token"]') | |
headers['X-CSRF-Token'] = csrfTokenElement.content if csrfTokenElement | |
$('div[data-render-async-path]').each (_i, div) -> | |
$.ajax( | |
url: $(this).data('render-async-path') | |
method: 'GET' |
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
# frozen_string_literal: true | |
module Gretel | |
module ViewHelpers | |
delegate :breadcrumbs_json_ld, to: :gretel_renderer | |
end | |
class Renderer | |
# rubocop:disable Rails/OutputSafety | |
def breadcrumbs_json_ld |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/bin/sh | |
if [ $# -eq 0 ]; then | |
echo "Usage:" | |
echo "git wip (branch-name) (issue-number)" | |
exit 2 | |
fi | |
issue_number='' | |
issue_title='' | |
branch_name=$1 | |
if [ $# -eq 2 ]; then |
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
select#user_time_zone.t1-select name="user[time_zone]" | |
option data-offset="-39600" value=("International Date Line West") (GMT-11:00) International Date Line West | |
option data-offset="-39600" value=("Midway Island") (GMT-11:00) Midway Island | |
option data-offset="-39600" value="Samoa" (GMT-11:00) Samoa | |
option data-offset="-36000" value="Hawaii" (GMT-10:00) Hawaii | |
option data-offset="-32400" value="Alaska" (GMT-09:00) Alaska | |
option data-offset="-28800" value=("Pacific Time (US & Canada)") (GMT-08:00) Pacific Time (US & Canada) | |
option data-offset="-28800" value="Tijuana" (GMT-08:00) Tijuana | |
option data-offset="-25200" value=("Mountain Time (US & Canada)") (GMT-07:00) Mountain Time (US & Canada) | |
option data-offset="-25200" value="Arizona" (GMT-07:00) Arizona |
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
$(function(){ | |
// Turbolinksの効いたリンクをクリックした時 | |
$(document).on('turbolinks:click' , function(){ | |
console.log("turbolinks:click"); | |
}); | |
// Turbolinksによる遷移が始まる直前(キャンセル可能) | |
$(document).on('turbolinks:before-visit', function(){ | |
console.log("Turbolinksによる遷移が始まる直前(キャンセル可能):turbolinks:before-visit"); | |
}); |
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
return true; |
NewerOlder