Skip to content

Instantly share code, notes, and snippets.

View AmauryVanEspen's full-sized avatar

Amaury Van Espen AmauryVanEspen

View GitHub Profile
@AmauryVanEspen
AmauryVanEspen / imath-pm-friends-only.php
Created May 2, 2023 13:12 — forked from imath/imath-pm-friends-only.php
I was writing my second BuddyPress tutorial for wpformation.com when i realized it could be helpful for a community admin to restrict private messages to friends only...
<?php
/*** beginning of the code to paste in your functions.php ***/
function imath_pm_button_only_if_friends( $button ) {
if( is_super_admin() )
return $button;
if( 'is_friend' != friends_check_friendship_status( bp_displayed_user_id(), bp_loggedin_user_id() ) )
return false;
@AmauryVanEspen
AmauryVanEspen / gas_qbo_oauth2.js
Created July 18, 2020 12:49 — forked from goelp/gas_qbo_oauth2.js
Google Apps Script OAuth2 script for QuickBooks integration with Google Sheets
var CLIENT_ID = '...'; // Get from Quickbooks Developer Console
var CLIENT_SECRET = '...'; // Get from Quickbooks Developer Console
var BASE_AUTH_URL = 'https://appcenter.intuit.com/connect/oauth2';
var TOKEN_URL = 'https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer';
var API_SCOPE = 'com.intuit.quickbooks.accounting';
var REDIRECT_URI = '...'; // Generate using the logRedirectUri() function mentioned at the end of this script
var RESPONSE_TYPE = 'code';
/**
* Authorizes and makes a request to the Quickbooks API using OAuth 2.
@AmauryVanEspen
AmauryVanEspen / git_submodules.md
Last active August 15, 2018 23:51 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

update from https://git-scm.com/book/en/v2/Git-Tools-Submodules

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules: