Skip to content

Instantly share code, notes, and snippets.

View hatsumatsu's full-sized avatar
🛸

Martin Wecke hatsumatsu

🛸
View GitHub Profile
"use strict";
(self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([[25], {
2025: function(e, r, t) {
t.r(r),
t.d(r, {
default: function() {
return S
}
});
var n = t(5893)
@hatsumatsu
hatsumatsu / k01.js
Created December 11, 2023 10:11
K01
var qg = function() {
function t() {
var e = this;
fo(this, t),
this.width = window.innerWidth,
Mo() ? this.height = window.innerHeight + 100 : this.height = window.innerHeight,
this.actif = !1,
this.scene = new jp,
this.scene1 = new jp,
this.clock = new Tg,

Moin Jason! Als Input wenn du heut in das Styling der Site einsteigst, sind mir noch ein paar Punkte eingefallen:

emotion bietet verschiedene Ansätze Styles in react zu schreiben, wobei manche performanter sind als andere. Grundsätzlich ist es empfohlen Styles “dry” und statisch zu halten, damit sie nicht bei jedem Render neu geparst, serialisiert und angewendet werden. In den Docs wird das u.a. hier beschrieben:

https://emotion.sh/docs/best-practices

Dynamische styles, die z.b. abhängig von Props einer Komponente sind, können z.B. easy und performant über classes oder data-attributes abgebildet werden.

Dynamic styles (nicht so performant):

# Spoof MAC address, generated by openssl
networksetup -setairportpower en0 off && sleep 1 && networksetup -setairportpower en0 on && sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') && networksetup -detectnewhardware
// What we learned:
// Apparently there is no way to have a ArToolkitContext working well with a portrait mode video stream
//
//
//
import {
ArToolkitProfile,
ArToolkitSource,
ArToolkitContext,
input
.replace( /^\[\"/, '' )
.replace( /\"\]$/, '' )
.split('|')
@hatsumatsu
hatsumatsu / README.md
Created February 5, 2021 08:18 — forked from a-barbieri/README.md
WP_GraphQL Relevanssi Plugin

WP_GraphQL Relevanssi Plugin

A plugin to enable Relevanssi research through WP_GraphQL.

Requirements

This plugin requires Relevanssi >= 4.6.0 and WP_GraphQL >= 0.8.0.

GraphQL query format

<?php
add_filter( 'wp_get_attachment_metadata', function( $data ) {
if( is_admin() ) {
return $data;
}
if( !array_key_exists( 'file', $data ) ) {
return $data;
}
query MyQuery( $now: Date ) {
allWordpressWpExhibitions(sort: {fields: acf___starting_date, order: ASC}, filter: {acf: {starting_date: {gt: $now}}}) {
nodes {
title
acf {
starting_date
}
}
}
}
@hatsumatsu
hatsumatsu / lukas.php
Last active March 12, 2019 11:56
Custom query vars, rewrite rules and admin columns
/**
* Make a custom permalink structure on top of a custom post type for yearly archives
* mapping the year to a meta field
*/
/**
* Register a custom query variable in our example 'event_year'
* This can later be used in WP_Query like `get_query_var( 'event_year' )`