Skip to content

Instantly share code, notes, and snippets.

@KeeperPat
KeeperPat / private.xml
Created December 30, 2016 15:31
Karabiner Configuration to Remap Surface Ergonomic Keyboard Alt and Windows Keys for Mac
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>Microsoft</vendorname>
<vendorid>0x045e</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>SurfaceErgonomic</productname>
<productid>0x0817</productid>
@davebarnwell
davebarnwell / PHP composer tools.md
Last active April 3, 2024 09:11
Global installation of PHP tools with Composer

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
@markjaquith
markjaquith / wp-update-plugins-git.sh
Created August 5, 2016 13:17
Update all WordPress plugins using WP-CLI and make a separate git commit for each one
#!/bin/bash
PLUGINS=$(wp plugin list --update=available --field=name | tr -d '\r');
wp plugin update-all;
for plugin in $PLUGINS; do
git add -A "wp-content/plugins/$plugin";
git commit -m "Update plugin: $plugin";
done;
@kellenmace
kellenmace / wp-admin-switcher-bookmark-source.js
Created July 4, 2016 17:20
WordPress Admin Switcher Bookmark Source
var WordPressAdminSwitcherBookmark = {};
/**
* Switch to/from the WordPress Admin.
*/
WordPressAdminSwitcherBookmark.toggleAdmin = function() {
if ( WordPressAdminSwitcherBookmark.isWordPressAdmin( window.location.pathname ) ) {
WordPressAdminSwitcherBookmark.switchToFrontEnd();
} else {
WordPressAdminSwitcherBookmark.switchToAdmin();
@BinaryMoon
BinaryMoon / jetpack-related-posts-test.php
Last active December 2, 2019 06:45
Display Jetpack Related Posts in a local environment. Note that the thumbnails won't load - but it's good enough to be able to test styles
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@brichards
brichards / rewrites-1.php
Created February 28, 2016 23:25
In all of the below cases permalinks have been flushed. The endpoint works perfectly fine for all scenarios _except_ the home page.
Using only this, hiting ^/bpa/whatever/ serves blog archive instead of static front page.
<?php
/**
* Create url endpoint for BPA
*
* @since 1.0.0
*/
function cfpurl_rewrite_rules() {
@niksumeiko
niksumeiko / disable-html-form-input-autocomplete-autofill.md
Last active May 8, 2024 19:35
Disable HTML form input autocomplete and autofill

Disable HTML Form Input Autocomplete and Autofill

  1. Add autocomplete="off" onto <form> element;
  2. Add hidden <input> with autocomplete="false" as a first children element of the form.
<form autocomplete="off" method="post" action="">
    <input autocomplete="false" name="hidden" type="text" style="display:none;">
    ...
@leymannx
leymannx / gulpfile.js
Last active July 13, 2023 15:29
Gulp Sass with autoprefixer and minify.
var gulp = require('gulp'),
sass = require('gulp-sass'),
rename = require('gulp-rename'),
cssmin = require('gulp-cssnano'),
prefix = require('gulp-autoprefixer'),
plumber = require('gulp-plumber'),
notify = require('gulp-notify'),
sassLint = require('gulp-sass-lint'),
sourcemaps = require('gulp-sourcemaps');
// Temporary solution until gulp 4
@hofmannsven
hofmannsven / README.md
Last active October 6, 2023 21:05
Storing WordPress files and database with WP-CLI on the server.

WordPress Backups with WP-CLI