🤷♂️
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
const {ServerSideRender} = wp.components; | |
wp.blocks.registerBlockType('test/ssr', { | |
title: 'Post Archiv', | |
icon: 'grid-view', | |
category: 'my-category', | |
edit(props) { | |
return <ServerSideRender block="test/ssr"/> | |
}, | |
save() { |
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
<ifModule mod_headers.c> | |
# One year for image and video files | |
<filesMatch ".(flv|gif|ico|jpg|jpeg|mp4|mpeg|png|svg|swf|webp)$"> | |
Header set Cache-Control "max-age=31536000, public" | |
</filesMatch> | |
# One month for JavaScript and PDF files | |
<filesMatch ".(js|pdf)$"> | |
Header set Cache-Control "max-age=2592000, public" | |
</filesMatch> |
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 loadFont(t, e, n) { | |
return new Promise(resolve => { | |
const a = navigator.userAgent; | |
if (window.addEventListener && (!a.match(/(Android (2|3|4.0|4.1|4.2|4.3))|(Opera (Mini|Mobi))/) || a.match(/Chrome/))) { | |
let o = {}; | |
try { | |
o = localStorage || {} | |
} catch (t) {} | |
const r = t, i = r + "url", s = r + "css", d = o[i], c = o[s], l = document.createElement("style"); | |
if (l.rel = "stylesheet", document.head.appendChild(l), !c || d !== e && d !== n) { |
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 | |
namespace NicoMartin; | |
/** | |
* Media Sideload | |
* Plugin Name: NM Media Sideload | |
* Description: Sideload an Image from a Post-Meta to your attachments | |
* Version: 0.1.0 | |
* Author: Nico Martin |
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 | |
add_filter( 'get_pages', 'add_posts_to_frontpage_dropdown', 20, 2 ); | |
add_action( 'pre_get_posts', 'update_frontpage_post_query' ); | |
function add_posts_to_frontpage_dropdown( $pages, $r ) { | |
if ( array_key_exists( 'name', $r ) && 'page_on_front' == $r['name'] ) { | |
$args = [ | |
'post_type' => 'post', |
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
# BEGIN CACHIFY | |
<IfModule mod_rewrite.c> | |
# ENGINE ON | |
RewriteEngine on | |
RewriteBase / | |
# set hostname directory | |
RewriteCond %{HTTPS} on | |
RewriteRule .* - [E=CACHIFY_HOST:https-%{HTTP_HOST}] | |
RewriteCond %{HTTPS} off |
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 async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXX-X"></script> | |
<script> | |
window.gtagTrackingID = 'UA-XXXXXXXX-X'; | |
window.gtagDisableStr = 'gtag-disable-' + gtagTrackingID; | |
window.dataLayer = window.dataLayer || []; | |
function gtag() { | |
dataLayer.push(arguments); | |
} |
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
/** | |
* @param $attach_id | |
* @param $width | |
* @param $height | |
* @param bool $crop | |
* | |
* @return false|array Returns an array (url, width, height, is_intermediate), or false, if no image is available. | |
*/ | |
function hello_image_resize( $attach_id, $width, $height, $crop = false ) { |
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
#!/bin/bash | |
FILE=style.css | |
BRANCH=`git rev-parse --abbrev-ref HEAD` | |
# read every line and serach Version | |
while read line; do | |
if [[ $line == *"Version: "* ]]; then | |
VERSION=${line/Version: /} | |
fi |