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
pipelines: | |
custom: | |
build-and-deploy: | |
- step: | |
name: Build and Push Docker image | |
image: amazon/aws-cli # Convenience image with aws-cli. | |
oidc: true # Required for AWS CLI to use OIDC token. | |
services: | |
- docker | |
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
/** | |
* @file Supports displaying previews of pages. | |
* | |
* Should be queried like this: https://my-site/_preview/?slug=my-page&preview_key={MY_SECRET_KEY} | |
*/ | |
import { GetServerSideProps, GetStaticProps, NextPage } from "next"; | |
import _ from "lodash"; | |
import { ParsedUrlQuery } from "querystring"; |
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
<script> | |
export default { | |
name: 'autocomplete', | |
props: { | |
items: { | |
type: Array, | |
required: false, | |
default: () => [], | |
}, | |
isAsync: { |
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
if (typeof ga === "function") { | |
ga.getAll().forEach((tracker) => { | |
tracker.set('page', '/my/path'); // <- change here | |
tracker.send('pageview'); | |
}); | |
} | |
// ES5 version for backward compatibility | |
if (typeof ga === "function") { | |
ga.getAll().forEach(function (tracker) { |
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
document.addEventListener("DOMContentLoaded", function () { | |
var touchDetect = function () { | |
document.documentElement.classList.add("has-touch"); | |
document.removeEventListener("touchstart", touchDetect); | |
}; | |
var hoverDetect = function () { | |
document.documentElement.classList.add("has-hover"); | |
document.removeEventListener("mouseenter", hoverDetect); | |
}; |
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
class MyControllerTest < ActionDispatch::IntegrationTest | |
test "authentication" do | |
params = {test: "object"} | |
auth_headers = {"Authorization" => "Basic #{Base64.encode64('test:test')}"} | |
post '/my-controller', params: params, as: :json | |
assert_response 401 | |
post '/my-controller', params: params, as: :json, headers: auth_headers | |
assert_response :success | |
end |
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
{ | |
... | |
"hooks": { | |
"postDeploy": "./clevercloud/post-deploy.sh" | |
}, | |
... | |
} |
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
<?php | |
// See https://github.com/bolt/bolt/issues/4290 | |
namespace Bolt\Extension\Stoco\ConfigCacheFix; | |
use Bolt\Application; | |
use Bolt\BaseExtension; | |
use Symfony\Component\HttpFoundation\Request; |
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() { | |
// Get the current domain name without any sub domains. | |
var internalDomain = (function () { | |
var domainParts = [], | |
hostnameParts = location.hostname.split("."), | |
i; | |
if (hostnameParts.length == 1) { | |
return location.hostname; |
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
<?php if (!empty($items) && !empty($items[0]) && !empty($items[0]['#markup'])): ?> | |
<div class="<?php print $classes; ?>"<?php print $attributes; ?>> | |
<?php if ($multiple): ?> | |
<?php if (!$label_hidden && $label) : ?> | |
<h3 class="field-label"<?php print $title_attributes; ?>><?php print $label ?></h3> | |
<?php endif; ?> | |
<ul class="field-items"> | |
<?php foreach ($items as $item) : ?> | |
<li class="field-item"><?php print render($item); ?></li> |
NewerOlder