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 / custom-notification.php
Last active April 2, 2024 18:18
BuddyPress add custom notification
<?php
// this is to add a fake component to BuddyPress. A registered component is needed to add notifications
function custom_filter_notifications_get_registered_components( $component_names = array() ) {
// Force $component_names to be an array
if ( ! is_array( $component_names ) ) {
$component_names = array();
}
// Add 'custom' component to registered components array
@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 ) {
@modemlooper
modemlooper / moderate-filter.php
Created September 14, 2017 00:57
add moderate filter to groups loop
/**
* Adds moderater filter to groups loop
*
* @return void
*/
function otc_group_moderate_option_filter() {
?>
<option value="moderate"><?php _e( 'Moderate' ); ?></option>
<?php
}
--
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 / wordpress.json
Last active November 17, 2022 16:07
Config file for Insomnia REST app for WP-API dev - change base_url, username, password and import into app
{
"_type": "export",
"__export_format": 2,
"__export_date": "2016-11-03T03:57:14.655Z",
"__export_source": "insomnia.desktop.app:v3.6.6",
"resources": [
{
"modified": 1477842143375,
"created": 1477841988306,
"parentId": null,
@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 );
@modemlooper
modemlooper / php
Created January 29, 2016 21:40
Example on adding a page to user profile
<?php
/**
* Plugin Name: BP Add Page
* Plugin URI: https://webdevstudios.com
* Description: Example on adding a page to BuddyPress profiles
* Author: WebDevStudios
* Author URI: https://webdevstudios.com
* Version: 1.0.0
* License: GPLv2
*/