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
import { get } from "lodash"; | |
import getPalette from "tailwindcss-palette-generator"; | |
import plugin from "tailwindcss/plugin"; | |
import { createTailwindcss } from "@mhsdesign/jit-browser-tailwindcss"; | |
export const getTailwindConfig = (options: any, plugins: any[] = []) => { | |
const primary = get(options, "primaryColor", "#000"); | |
const secondary = get(options, "secondaryColor", "#ccc"); | |
const headingFont = get(options, "headingFont", "Inter"); |
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
.g-recaptcha { | |
> div{ | |
width: 100%; | |
height: auto; | |
} | |
} | |
.g-recaptcha{ | |
iframe{ | |
width: 100%; |
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
Raven.setUserContext({ | |
email: '[email protected]', | |
id: '123' | |
}) | |
// call this function to rmeove the association. Normally call this when the user logs out. | |
Raven.setUserContext() |
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
Raven.context(function() { | |
doSomething(a[0]) // possibly a[0] is undefined and hence will cause an exception | |
}) | |
var doIt = function() { | |
// errorenous code here | |
} | |
setTimeout(Raven.wrap(doIt), 1000) |
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
try { | |
doSomething(a[0]) // possibly can cause an exception | |
} catch(e) { | |
Raven.captureException(e) | |
} |
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
Raven.config('https://<key>@sentry.io/', { | |
release: '1.3.0' | |
}).install() |
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 | |
function wp_ampify_template_redirect(){ | |
if (!wp_is_mobile() ) | |
return; | |
$cur_url = esc_url((is_ssl() ? "https://" : "http://") . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"] ); | |
if(is_front_page() || is_home() || is_archive()){ | |
$cur_url .= '?amp=1'; | |
} |
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 | |
@header('AMP-Redirect-To: '. get_permalink($_POST['comment_post_ID']) . '#respond'); | |
@header('AMP-Access-Control-Allow-Source-Origin: ' . $_REQUEST['__amp_source_origin'] ); |
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 | |
function amp_comment_submit(){ | |
$comment = wp_handle_comment_submission( wp_unslash( $_POST ) ); | |
if ( is_wp_error( $comment ) ) { | |
$data = intval( $comment->get_error_data() ); | |
if ( ! empty( $data ) ) { | |
status_header(500); | |
wp_send_json(array('msg' => $comment->get_error_message(), | |
'response' => $data, | |
'back_link' => true )); |
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 method="post" id="commentform" target="_top" class="comment-form" novalidate="" action-xhr="<?php echo admin_url('admin-ajax.php?action=amp_comment_submit') ?>" target="_top"> | |
<p class="comment-notes"> | |
<span id="email-notes">Your email address will not be published.</span> Required fields are marked <span class="required">*</span> | |
</p> | |
<p class="comment-form-comment"> | |
<label for="comment">Comment</label> | |
<textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea> | |
</p> | |
<p class="comment-form-author"> | |
<label for="author">Name <span class="required">*</span></label> |