Skip to content

Instantly share code, notes, and snippets.

View maximilliangeorge's full-sized avatar

Maximillian George maximilliangeorge

  • Will and Max
  • Stockholm
View GitHub Profile
function newPopup1() {
console.log("Popup 1!");
popupWindow = window.open(
'http://www.beckmans.se', // Hemsida 3
'popUpWindow',
height=480,
width=480,
left=0,
top=0,
resizable=no,
@maximilliangeorge
maximilliangeorge / functions.php
Last active November 5, 2022 11:31
Fix memory leaks in wordpress admin
<?php
/**
* Disable Posts' meta from being preloaded
* This fixes memory problems in the WordPress Admin
*/
function jb_pre_get_posts( WP_Query $wp_query ) {
if ( in_array( $wp_query->get( 'post_type' ), array( 'my_post_type_1', 'my_post_type_2' ) ) ) {
$wp_query->set( 'update_post_meta_cache', false );
@maximilliangeorge
maximilliangeorge / README.md
Last active December 27, 2017 16:23
PoC REST API authorization

One of the coolest things about bitcoin is that identities/accounts aren't really registered anywhere. In a sense, every possible identity already exists, mathematically. This allows for some interesting approaches to UX that are different in crypto than in other ecosystems.

Here's is a simple example of an API that uses the user's public key as the endpoint. It requires each request to be signed using the user's private key.

Dependencies: NodeJS, bcoin, restler, express

Similar projects: Bitauth, BitID

@maximilliangeorge
maximilliangeorge / Users and Use Cases.md
Created February 4, 2018 00:31 — forked from tyzbit/1-Users and Use Cases.md
Lightning Network Users and Use Cases

Lightning Network User Use Cases

The Lightning Network is a layer 2 payment network built on top of Bitcoin. It is denominated in Bitcoin, and disputes are settled entirely by the Bitcoin network. Like Bitcoin, it is decentralized. Ultimately, the utility, speed and cost of the network will be defined by the sum of how all of the participants behave. In this post, I will explore at least 6 different user types I predict will exist on the Lightning Network and my expectation of how they will behave.

@maximilliangeorge
maximilliangeorge / images.json
Created October 1, 2018 20:05
DigitalOcean Images 2018
{
"images": [{
"id": 38123186,
"name": "1883.1.0 (beta)",
"distribution": "CoreOS",
"slug": "coreos-beta",
"public": true,
"regions": ["nyc1", "sfo1", "nyc2", "ams2", "sgp1", "lon1", "nyc3", "ams3", "fra1", "tor1", "sfo2", "blr1"],
"created_at": "2018-09-11T22:47:44Z",
"min_disk_size": 20,
@maximilliangeorge
maximilliangeorge / functions.php
Created October 31, 2018 14:14
Add ACF custom fields to the Wordpress JSON API
<?php
// Add ACF data to the WP JSON REST API
add_action('rest_api_init', 'create_api_posts_meta_field');
function create_api_posts_meta_field() {
function get_acf($post) {
@maximilliangeorge
maximilliangeorge / scrolling.js
Last active April 9, 2020 15:07
After Effects Expressions
// MOMENTUM SCROLLING
//
// Nice easings without the hassle. Doesn't work well for very long distances.
//
// 1. Separate dimensions on layer to scroll (right click _> separate dimensions)
// 2. Apply the expression to the layers Y Position
// 3. Add keyframes. Easing will adapt to mimic momentum scrolling.
const c = thisLayer("Transform")("Y Position")
@maximilliangeorge
maximilliangeorge / countdown.js
Last active April 9, 2020 15:05
AE Countdown
// COUNTDOWN
//
// Creates a countdown in the following format:
// 00D:00H:00M:00S
//
// 1. Create text layer
// 2. Apply expression to text property.
rate = -1;
clockStart = 930604.999;
@maximilliangeorge
maximilliangeorge / marker-sync.js
Last active April 9, 2020 15:04 — forked from animoplex/MarkerSyncExpression.jsx
Marker Sync - After Effects Expression by Animoplex
// MARKER SYNC
//
// Allows you to trigger playback of precomp segments using markers.
// This allows you to change timings without diving into precomps and makes it easier to reason about your project file.
//
// 1. Create a precomp A with a layer called "Controller"
// 2. Add named markers to the timeline within Controller.
// 3. In the parent comp, enable Time Remapping for the precomp A
//
// Modified expression based on Dan Ebbert's Marker Sync Expression
@maximilliangeorge
maximilliangeorge / carousel.js
Last active January 17, 2021 14:30
Pure function carousel wrap