Skip to content

Instantly share code, notes, and snippets.

View markbiek's full-sized avatar

Mark Biek markbiek

View GitHub Profile
images
@markbiek
markbiek / php.sh
Created June 4, 2021 15:34
Very complete script for switching PHP versions when using Laravel Valet
# Written by https://github.com/nickstewart95
echo Stop Brew
sudo brew services stop php
sudo brew services stop [email protected]
sudo brew services stop [email protected]
sudo brew services stop [email protected]
sudo brew services stop [email protected]
sudo brew services stop [email protected]
echo Unlinking previous PHP packages
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
require __DIR__ . '/vendor/autoload.php';
use Symfony\Component\DomCrawler\Crawler;
use Twilio\Rest\Client;
$sid = 'ABC123';
@markbiek
markbiek / plugin.php
Created December 9, 2019 13:53
Check for a specific PHP version from a WordPress plugin
//Load the current WP core version
include( ABSPATH . WPINC . '/version.php' );
if (version_compare($wp_version, '5.3') < 0) {
//If WP core is < 5.3, do a PHP version check ourselves
$php_version = phpversion();
if (version_compare($php_version, '7.1') < 0) {
die('This plugin requires PHP 7.1 or higher');
}
}
@markbiek
markbiek / slack-sidebar.css
Created April 22, 2019 15:25
Slack Sidebar Theme
#2D363F,#D6D8D7,#b5b5b5,#2D363F,#fafafa,#FFFFFF,#cccccc,#D6D8D7
curl -H 'Authorization: Bearer <token>' https://na59.salesforce.com/services/data/v37.0/sobjects
curl -H 'Authorization: Bearer <token>' "https://na59.salesforce.com/services/data/v37.0/query/?q=SELECT+Id+FROM+Contact+WHERE+Account__c='SalesforceId'"
curl -H "Authorization: Bearer <token>" https://na59.salesforce.com/services/data/v37.0/limits
curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' --data "grant_type=password&client_id=key&client_secret=secret&[email protected]&password=mypassword" https://login.salesforce.com/services/oauth2/token</token>
@markbiek
markbiek / store.js
Created March 1, 2018 20:34
remote-redux-devtools config
import { composeWithDevTools } from 'remote-redux-devtools';
//All of your other store setup stuff
const composeEnhancers = composeWithDevTools({ realtime: true });
const store = createStore(
reducers,
composeEnhancers(
applyMiddleware(/* middleware stuff */)