Skip to content

Instantly share code, notes, and snippets.

😀
Happy

Micah Wood wpscholar

😀
Happy
View GitHub Profile
@wpscholar
wpscholar / cloudSettings
Last active Jun 9, 2020
Visual Studio Code Settings
View cloudSettings
{"lastUpload":"2020-06-09T16:20:28.851Z","extensionVersion":"v3.4.3"}
@earnjam
earnjam / .bash_profile
Created Sep 28, 2018
Custom bash profile
View .bash_profile
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# 6. Networking
# 7. System Operations & Information
View block.js
(function (wp) {
//WordPress APIs
//Render function
var el = wp.element.createElement;
//Translations
var __ = wp.i18n.__;
//Text input control
var TextControl = wp.blocks.InspectorControls.TextControl;
//Create block
wp.blocks.registerBlockType('shelob9/metatest2', {
View worker.js
// https://developers.cloudflare.com/workers/about/
// https://tutorial.cloudflareworkers.com
//
// A Service Worker which adds Security Headers.
// Checks:
// https://securityheaders.io/
// https://observatory.mozilla.org/
// https://csp-evaluator.withgoogle.com/
// https://hstspreload.org/
// https://www.ssllabs.com/ssltest/
@micc83
micc83 / mysqldump.php
Created Jun 5, 2017
Simple PHP script to dump a MySql database
View mysqldump.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$database = 'db';
$user = 'user';
$pass = 'pass';
$host = 'localhost';
@samthor
samthor / safari-nomodule.js
Last active Jul 5, 2020
Safari 10.1 `nomodule` support
View safari-nomodule.js
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
* <script nomodule>alert('no modules');</script>.
*
* This workaround is possible because Safari supports the non-standard 'beforeload' event.
* This allows us to trap the module and nomodule load.
@neilgee
neilgee / custom-provision.sh
Created Jul 13, 2015
Custom VVV Variable Provisioning for WordPress sites
View custom-provision.sh
# #!/bin/bash
# #
# # provision.sh
# #
# # This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# # provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# # or `vagrant reload` are used. It provides all of the default packages and
# # configurations included with Varying Vagrant Vagrants.
# # By storing the date now, we can calculate the duration of provisioning at the
@FrankM1
FrankM1 / provision.sh
Created May 18, 2015
Faster provisioning for vvv - Removed provisioning for Wordpress Core development. That took a long time to complete
View provision.sh
#!/bin/bash
#
# provision.sh
#
# This file is specified in Vagrantfile and is loaded by Vagrant as the primary
# provisioning script whenever the commands `vagrant up`, `vagrant provision`,
# or `vagrant reload` are used. It provides all of the default packages and
# configurations included with Varying Vagrant Vagrants.
# By storing the date now, we can calculate the duration of provisioning at the
@thomasgriffin
thomasgriffin / api-helper.php
Last active Mar 13, 2019
API Helper to be used during API requests. Should be used as a must-use plugin in WordPress.
View api-helper.php
<?php
/**
* Plugin Name: TGM API Helper
* Plugin URI: https://thomasgriffin.io
* Description: Whitelists the plugins to be loaded during API requests to reduce overhead.
* Author: Thomas Griffin
* Author URI: https://thomasgriffin.io
* Version: 1.0.0
*/
@fversnel
fversnel / SmartSortable.js
Created Dec 30, 2014
React SmartSortable
View SmartSortable.js
var cloneWithProps = React.addons.cloneWithProps;
var SmartSortable = React.createClass({
getDefaultProps: function() {
return {component: "ul", childComponent: "li"};
},
render: function() {
var props = jQuery.extend({}, this.props);
You can’t perform that action at this time.