Skip to content

Instantly share code, notes, and snippets.

Josh Cunningham joshcanhelp

Block or report user

Report or block joshcanhelp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
joshcanhelp / SetAccessTokenCookie.php
Last active Feb 6, 2019
Auth callback middleware to set an access token in Laravel
View SetAccessTokenCookie.php
// app/Http/Middleware/SetAccessTokenCookie.php
namespace App\Http\Middleware;
use Closure;
class SetAccessTokenCookie
joshcanhelp / laravel-auth0.php
Last active Jan 29, 2019
Laravel config settings for Auth0 API authentication
View laravel-auth0.php
// config/laravel-auth0.php
return [
// ...
// Your Auth0 domain as a URL with a trailing slash.
'authorized_issuers' => [ '' ],
// The "Identifier" field for the API you created in Auth0.
'api_identifier' => 'https://quickstarts/api',
// This is the same as the API algorithm.
'supported_algs' => [ 'RS256' ],
joshcanhelp / CheckJWT.php
Last active Jan 29, 2019
Laravel middleware for access token verification on an API
View CheckJWT.php
// app/Http/Middleware/CheckJWT.php
namespace App\Http\Middleware;
use Closure;
use Auth0\SDK\JWTVerifier;
class CheckJWT {
public function handle($request, Closure $next) {
joshcanhelp / sdk_quality_scripts.js
Last active Feb 16, 2019
Google Script Editor functions for getting SDK quality metrics
View sdk_quality_scripts.js
/* globals SpreadsheetApp, Browser, CacheService, UrlFetchApp, PropertiesService */
* Macro functions
* Prompt the user for a GitHub API token.
View Sample DB login script
function login (email, password, callback) {
var request = require("request");
form: {
joshcanhelp / get_connection.json
Created Oct 10, 2018
Sample get connection response
View get_connection.json
"id": "[REDACTED]",
"options": {
"mfa": {
"active": true,
"return_enroll_settings": true
"passwordPolicy": "[REDACTED]",
"enabledDatabaseCustomization": true,
"requires_username": true,
joshcanhelp / lock-options-with-state.js
Created Jun 26, 2018
How the Lock options object should look in View Source
View lock-options-with-state.js
var wpAuth0LockGlobal = {"settings":{"auth":{"params":{"state":"STATE_VALUE_FROM_AUTH0_STATE_COOKIE","scope":"openid email profile"},"responseType":"code","redirectUrl":"http:\/\/wp.localhost.test\/wp\/index.php?auth0=1","sso":true},"passwordlessMethod":"link","socialButtonStyle":"small","container":"auth0-login-form"},"ready":"1","domain":"","clientId":"YOUR_CLIENT_ID","stateCookieName":"auth0_state","nonceCookieName":"auth0_nonce","usePasswordless":"","loginFormId":"auth0-login-form","showAsModal":"","i18n":{"notReadyText":"Auth0 is not configured","cannotFindNodeText":"Auth0 cannot find node with id ","modalButtonText":"Login"}};
joshcanhelp /
Last active Jun 6, 2018
Copy git repo tags to an svn directory
# Change "grep ^3." to filter by a different major (or remove)
# Change "~/Sites/wp-svn" to the correct path to your local svn repo
# Change rsync excludes, if needed
# Run this in a git repo with tags
for f in $(git tag -l | grep ^3.); do git checkout tags/"$f"; rsync -rv --exclude .git --exclude vendor ./ ~/Sites/wp-svn/tags/"$f"; done
joshcanhelp /
Last active Jul 2, 2018
Generate a WP instance locally - WIP
# #########
# Variables
# #########
joshcanhelp / wp_auth0_default_settings.json
Created May 7, 2018
Default WP-Auth0 settings for reset
View wp_auth0_default_settings.json
You can’t perform that action at this time.