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
export function loadImage(url) { | |
return new Promise(resolve => { | |
const image = new Image(); | |
image.addEventListener('load', () => { | |
resolve(image); | |
}); | |
image.src = url; | |
}); | |
} |
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 Entity from '../Entity.js'; | |
import Trait from '../Trait.js'; | |
import Killable from '../traits/Killable.js'; | |
import {loadSpriteSheet} from '../loaders/sprite.js'; | |
export function loadCheepSlow() { | |
return loadSpriteSheet('cheep-gray') | |
.then(createCheepSlowFactory); | |
} |
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
<filesMatch ".(ico|pdf|flv|jpg|jpeg|png|webp|svg|gif|woff|woff2|js|css)$"> | |
Header set Cache-Control "max-age=31536000, public" | |
Header append Vary: Accept-Encoding | |
Header set Access-Control-Allow-Origin “*” | |
</filesMatch> | |
<ifmodule mod_deflate.c> | |
<ifmodule mod_mime.c> | |
AddType application/x-font-ttf .ttf | |
AddType application/font-woff .woff |
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 createTileCandidateLayer(tileResolver) { | |
const resolvedTiles = []; | |
const tileSize = tileResolver.tileSize; | |
const getByIndexOriginal = tileResolver.getByIndex; | |
tileResolver.getByIndex = function getByIndexFake(x, y) { | |
resolvedTiles.push({x, y}); | |
return getByIndexOriginal.call(tileResolver, x, y); | |
} |
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
$jq_integrity = 'sha256-xNzN2a4ltkB44Mc/Jz3pT4iU1cmeR0FkXs4pru/JxaQ='; | |
$jq_crossorigin = 'anonymous'; | |
$jq_cdn = 'https://code.jquery.com/jquery-3.5.0.min.js'; | |
$jq_version = '3.5.0'; | |
if(! is_admin()){ | |
function add_cdn_attrs( $tag, $handle, $src ) { | |
global $jq_integrity, $jq_crossorigin; |
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
// exclude pages from wp search | |
if ( !is_admin() ) { | |
function exclude_pages( $query ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', 'post' ); | |
} | |
return $query; | |
} | |
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
add_filter( 'upload_mimes', 'add_webp', 1, 1 ); | |
function add_webp( $mime_types ) { | |
$mime_types['webp'] = 'image/webp'; | |
return $mime_types; | |
} |
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
add_action('wp_footer', 'add_partner_id'); | |
function add_partner_id() { | |
echo ' | |
<script> | |
( function( $ ) { | |
$("a[href*=\'thomann.de\']").each(function() { | |
$(this).attr("href", $(this).attr("href") + "?partner_id=XXXX"); | |
}); | |
} )( jQuery ) |
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
// https://jsfiddle.net/hwt3fjL1/ | |
@keyframes txt-load { | |
0% {content:".";} | |
50% {content:"..";} | |
} | |
body { | |
font-size: 30px; | |
} |
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*="sss"]:after { | |
content: "warning: css class name typo?" | |
color: f00; | |
} |
NewerOlder