Skip to content

Instantly share code, notes, and snippets.

Travis Smith wpsmith

Block or report user

Report or block wpsmith

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
@menushka
menushka / airdropSorter.scpt
Created Dec 30, 2018
A Folder Action script written in AppleScript used to separate AirDropped files into a different folder other than the default Downloads folder
View airdropSorter.scpt
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format"
property QUARANTINE_KEY : "59"
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '"
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'"
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to length of added_items
set current_item to item i of added_items
set quarantine_type to getQuarantineType(POSIX path of current_item)
@byronfriesen
byronfriesen / aws-linux-2-wordpress.sh
Last active Nov 13, 2019
Amazon Linux 2 LTS - Wordpress / PHP-FPM / NGINX / MariaDB / WP-CLI Auto Install
View aws-linux-2-wordpress.sh
#!/bin/bash
##############################################################
# Set Your System and Wordpress Config Preferences
##############################################################
export SYSTEM_USER=username # User PHP-FPM runs under
# Database
export WP_DB_NAME=wordpress
@deanhume
deanhume / clear-cache.js
Created Sep 20, 2017
Clear Service Worker Cache
View clear-cache.js
if ('serviceWorker' in navigator) {
caches.keys().then(function(cacheNames) {
cacheNames.forEach(function(cacheName) {
caches.delete(cacheName);
});
});
}
@davebarnwell
davebarnwell / PHP composer tools.md
Last active Nov 13, 2019
Global installation of PHP tools with Composer
View PHP composer tools.md

Global installation of PHP tools with Composer

To install a composer package globally, you run the usual require command, but with the addition of the global modifier. So to install PHPUnit, you would run:

$ composer global require phpunit/phpunit
$ composer global require phpunit/dbunit
$ composer global require phing/phing
$ composer global require phpdocumentor/phpdocumentor
$ composer global require sebastian/phpcpd
@nrollr
nrollr / Commands.sh
Last active Nov 13, 2019
Install PHP and NGINX on Amazon Linux AMI
View Commands.sh
## Install NGINX
## when installing on Amazon Linux AMI, use:
$ sudo yum install nginx -y
## when installing on Amazon Linux 2 AMI, use
$ sudo amazon-linux-extras install nginx1.12 -y
## Install PHP and PHP-FPM
# for PHP version 7.1 use php71 and php71-fpm instead
$ sudo yum install php -y
$ sudo yum install php-fpm -y
@chrismccoy
chrismccoy / restapi.txt
Last active Oct 29, 2019
WordPress REST API Resources
View restapi.txt
Allow ALL cross origin requests to WordPress REST API
https://github.com/Shelob9/rest-all-cors
WordPress theme using Rest API and Vue.js
https://github.com/rtCamp/VueTheme
WordPress Post from Front End using REST API and Vue.js
http://jimfrenette.com/2017/01/post-from-front-end-wp-api-vuejs/
An offline-first SPA using Vue.js, the WordPress REST API and Progressive Web Apps
@bdougherty
bdougherty / Rules.1blockpkg
Created Nov 6, 2015
My custom 1Blocker packages
View Rules.1blockpkg
[{
"id": "0aefa581-b042-4f36-b39c-74daa33b682a",
"name": "Block Annoying Article Stuff",
"rules": [{
"id": "634b4fd6-e2c9-4ce4-bcf9-0d52b4c74baa",
"name": "The Atlantic",
"content": {
"trigger": {
"url-filter": "^[^:]+://+([^:/]+\\.)?theatlantic\\.com[:/]",
"url-filter-is-case-sensitive": true,
@wpsmith
wpsmith / sm-annotated.html
Created Oct 22, 2015 — forked from hdragomir/sm-annotated.html
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
View sm-annotated.html
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@mattboon
mattboon / webfont-localstorage.js
Last active Jun 26, 2016
webfont-localstorage.js
View webfont-localstorage.js
function supportsWoff2() {
"use strict";
/*global FontFace*/
// Source: https://github.com/filamentgroup/woff2-feature-test
if (!window.FontFace) {
return false;
} else {
var f = new FontFace('t', 'url("data:application/font-woff2,") format("woff2")', {});
f.load();
return f.status === 'loading';
You can’t perform that action at this time.