Skip to content

Instantly share code, notes, and snippets.

View modemlooper's full-sized avatar
🏠
Working from home

modemlooper modemlooper

🏠
Working from home
View GitHub Profile
@modemlooper
modemlooper / gist:4d73a5eae9e76d91b9538ff37d416b52
Created January 29, 2024 14:41
Remove BuddyPress no component pages notice
/**
* Remove BP pages nag.
*
* @return void
*/
function appp_remove_bp_pages_notices() {
$notices = buddypress()->admin->notices;
foreach ( $notices as $key => $notice ) {
--
format_version: '11'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: ionic
workflows:
Deploy_Android:
steps:
- activate-ssh-key@4:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@8.1: {}
@modemlooper
modemlooper / index.html
Created August 18, 2023 14:49
phaser test
<html>
<head>
<title>Gamefroot Arcade</title>
<style>
body, html {
margin: 0;
padding: 0;
background: black;
overflow: hidden;
}
@modemlooper
modemlooper / gist:bf9a180b151ed0320c7e005246b73489
Created April 6, 2023 18:00
Load WordPress media from prod NGINX
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ {
try_files $uri @image_fallback;
}
location @image_fallback {
proxy_pass http://{PROD};
}
@modemlooper
modemlooper / fake.js
Created October 30, 2022 15:53
Fake async await
async function fakeasync() {
const waitFor = delay => new Promise(resolve => setTimeout(resolve, delay));
await waitFor(3000);
}
@modemlooper
modemlooper / cors.php
Created June 14, 2022 00:17
allow cors wp-api
/**
* Allow cross domain api access from iOS and Android
*
* @param WP_Rest_Request $request
* @return void
*/
function appp_init_cors( $request ) {
$origin_url = '*';
header( 'Access-Control-Allow-Origin: ' . $origin_url );
<ion-header>
<ion-toolbar color="clear">
<ion-buttons slot="start">
</ion-buttons>
<ion-title></ion-title>
<ion-buttons slot="end">
</ion-buttons>
</ion-toolbar>
</ion-header>
@modemlooper
modemlooper / gist:39cdc585b146894a407cb32a830eed7d
Created November 27, 2020 17:18
use WordPress production media on local nginx
location ~ ^(/wp-content/themes|/wp-content/uploads)/.*\.(jpe?g|gif|css|png|js|ico|pdf|m4a|mov|mp3)$ {
rewrite ^ http://domain.com$request_uri?
permanent;
access_log off;
}
@modemlooper
modemlooper / bp-group-create-admin.php
Last active August 18, 2020 01:43
Admin page to create BuddyPress groups
<?php
/**
* BuddyPress Groups create admin screen.
*
* Props to WordPress core for the Comments admin screen, and its contextual
* help text, on which this implementation is heavily based.
*
* @package BuddyPress
* @subpackage Groups
*/
@modemlooper
modemlooper / gist:711e435aaa4661de7677696b5b0a1630
Created July 24, 2020 00:04
flywheel local use production media
# Load media in /uploads/ from remote site.
location ~ ^/wp-content/uploads/(.*) {
rewrite ^/wp-content/uploads/(.*)$ https://url.com/wp-content/uploads/$1 permanent;
}