Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: YOUR PLUGIN NAME
*/
include( dirname( __FILE__ ) . '/lib/requirements-check.php' );
$your_plugin_requirements_check = new YOUR_PREFIX_Requirements_Check( array(
'title' => 'YOUR PLUGIN NAME',
'php' => '5.4',
@k4zuki02h4t4
k4zuki02h4t4 / wordmove_with_localbyflywheel.sh
Last active January 30, 2021 07:37
Enable Wordmove with "Local by Flywheel".
#!/usr/bin/env bash
set -xu
RUBY_VERSION=2.4.1
LIBSSL_VERSION=$(dpkg -s libssl1.0.0 | grep -i ^version | awk '{print $2;}')
apt-get update -y
apt-get upgrade -y
apt-get install -y software-properties-common python-software-properties vim build-essential git python-setuptools ruby-build libssl-dev=${LIBSSL_VERSION}
@itzikbenh
itzikbenh / gulpfile.js
Last active December 21, 2018 06:25
gulp-webpack
var gulp = require('gulp');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var browserSync = require('browser-sync');
var csso = require('gulp-csso');
var uglify = require('gulp-uglify');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var postcssAnt = require('postcss-ant');
var webpack = require('webpack');
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active September 5, 2024 01:56
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@mikeschinkel
mikeschinkel / Allow_Youtube_Scripts.php
Created May 26, 2016 05:45
PHP script to sanitize HTML using wp_kses_post() except allow <script src="http://youtube.com/..." type="..."> tags.
<?php
$html = "...";
echo Allow_Youtube_Scripts::sanitize_html( $html );
class Allow_Youtube_Scripts {
static $allowed_protocols;
static function sanitize_html( $html ) {
@boogah
boogah / .bash_profile
Last active February 24, 2016 01:36
One command to upgrade npm, Atom packages & Homebrew. Based on http://blog.thibmaekelbergh.be/2015/12/15/5-minute-guide-to-keeping-your-system-updated.html
# Note: You won't have access to this command until you run `source ~/.bash_profile` or log back in!
# Call this from cron or run manually as needed.
function update() {
echo "" ; echo "`date`: RUNNING: npm update"
npm install npm -g # Update npm itself
echo "`date`: FINISHED: npm update" ; echo "" ; echo "`date`: RUNNING: npm package updates"
npm update -g # Update installed npm packages
echo "`date`: FINISHED: npm package updates" ; echo "" ; echo "`date`: RUNNING: atom update"
apm upgrade -c false # Update Atom packages & themes
@jb510
jb510 / ReadMe.md
Last active January 20, 2022 15:42 — forked from boogah/ale.bash
Auto Update Brew: OS X Launchd job and script to automatically update homebrew
  1. Place homebrewupdate.sh where ever you like, I use ~/bin/homebrewupdate.sh
  2. Place the .plist file in ~/Library/LaunchAgents and update the path to your bash script
  3. run launchctl load ~/Library/LaunchAgents/com.jb510.homebrewupdate.plist or whatever you've named your plist file.
  4. check launchctl list | grep jb510 to see that it's running

Note: You might need to chmod +x homebrewupdate.sh

Note 2: you can run this manually to test your script ~/bin/homebrewupdate.sh

Future: Update this to also update casks https://github.com/buo/homebrew-cask-upgrade or using brew cask list | xargs brew cask reinstall

@jacobarriola
jacobarriola / gist:622831bbd3fe90394412
Created September 15, 2015 14:08
Gulp file using sourcemaps
gulp.task('styles', function() {
gulp.src('assets/sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed'
})
.on('error', notify.onError(function(error) {
return "Error: " + error.message;
}))
)
@seancoyne
seancoyne / fix-google-drive-menu-bar-icons.sh
Created October 21, 2014 15:34
Fix Google Drive Yosemite Dark Mode Menu Bar Icons
#!/usr/bin/env bash
# change to proper directory
cd /Applications/Google\ Drive.app/Contents/Resources/
# back up the files
sudo mkdir icon-backups
sudo cp mac-animate*.png icon-backups/
sudo cp mac-error*.png icon-backups/
sudo cp mac-inactive*.png icon-backups/
@jtsternberg
jtsternberg / cmb2-number-field.php
Last active February 13, 2025 09:43
CMB2 Number Field
<?php
$cmb->add_field( array(
'name' => __( 'Postive numbers', 'theme-domain' ),
'desc' => __( 'Numbers only', 'msft-newscenter' ),
'id' => $prefix . 'number',
'type' => 'text',
'attributes' => array(
'type' => 'number',
'pattern' => '\d*',