Skip to content

Instantly share code, notes, and snippets.

{
"BTTWidgetName" : "CPU",
"BTTTriggerType" : 642,
"BTTTriggerTypeDescription" : "Shell Script \/ Task Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTShellScriptWidgetGestureConfig" : "\/bin\/bash:::-c",
"BTTEnabled2" : 1,
"BTTUUID" : "2242BFF7-6346-4EBF-AE18-407E91CFEA57",
{
"BTTTriggerType" : 632,
"BTTTriggerTypeDescription" : "Remaining Battery Time Widget",
"BTTTriggerClass" : "BTTTriggerTypeTouchBar",
"BTTPredefinedActionType" : -1,
"BTTPredefinedActionName" : "No Action",
"BTTEnabled2" : 1,
"BTTUUID" : "58565999-B2C5-48BB-943F-1B24CC662EC4",
"BTTEnabled" : 1,
"BTTOrder" : 2,
@y-krn
y-krn / functions.php
Last active December 9, 2016 10:09
AMP Custom Google Analytics
<?php
add_filter( 'amp_post_template_analytics', function ( $analytics ) {
if ( ! is_array( $analytics ) ) {
$analytics = array();
}
// https://developers.google.com/analytics/devguides/collection/amp-analytics/
$analytics['xyz-googleanalytics'] = array(
'type' => 'googleanalytics',
'attributes' => array(),
@y-krn
y-krn / single.php
Created December 9, 2016 09:16
AMP Custom Template Single.php
<!doctype html>
<html amp <?php echo AMP_HTML_Utils::build_attributes_string( $this->get( 'html_tag_attributes' ) ); ?>>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<?php do_action( 'amp_post_template_head', $this ); ?>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<style amp-custom>
<?php $this->load_parts( array( 'style' ) ); ?>
<?php do_action( 'amp_post_template_css', $this ); ?>
@y-krn
y-krn / fontawesome.css
Last active February 15, 2018 12:53
AMP Font Awesome Custom CSS
@font-face {
font-family: 'FontAwesome';
src: url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.eot?v=4.7.0');
src: url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('<?php echo get_template_directory_uri(); ?>/include/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
.fa {
display: inline-block;
font-family: FontAwesome;
@y-krn
y-krn / functions.php
Created December 9, 2016 09:04
AMP Custom Stylesheet
<?php
add_action( 'amp_post_template_css', function() {
?>
// Your style sheet here.
<?php
} );
?>
@y-krn
y-krn / functions.php
Last active December 9, 2016 09:05
AMP Custom Template
<?php
add_filter( 'amp_post_template_file', function ( $file, $type, $post ) {
if ( 'single' === $type ) {
$file = dirname( __FILE__ ) . '/include/amp/single.php';
}
return $file;
}, 10, 3 );
?>