Skip to content

Instantly share code, notes, and snippets.

@grappler
grappler / touchid_sudo.sh
Created Feb 21, 2021 — forked from RichardBronosky/touchid_sudo.sh
Use TouchID for sudo on modern MacBook Pro machines
View touchid_sudo.sh
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
View JW Player iframe video.html
<!DOCTYPE HTML>
<html>
<head>
<title>
JW Player Reponsive Video
</title>
<script type="text/javascript" src="//cdn.jsdelivr.net/jwplayer/5.10/jwplayer.js">
</script>
<style type="text/css">
html, body {
@grappler
grappler / Gruntfile.js
Last active Oct 5, 2020
https://webtranslateit.com/en/docs/web_translate_it_client/ / http://docs.transifex.com/developer/client/ Run this command in the folder to install all of the files needed. `npm install --save-dev`
View Gruntfile.js
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
makepot: {
target: {
@grappler
grappler / comopser-wp-cli.md
Last active Nov 22, 2019 — forked from neverything/comopser-wp-cli.md
Install composer and wp-cli on cyon.ch hostings with SSH access.
View comopser-wp-cli.md

Cyon.ch/Hostpoint - Install composer & wp-cli

SSH into your server and stay in the home directory of the user. Check if you have a bin directory in your user directory already, in case you do, omit the mkdir bin.

Use bin folder in $HOME for user scriptsr

For the commands to be loaded from the bin directory run echo "export PATH=$HOME/bin:$PATH" >> ~/.bashrc. For the new config to be used run source ~/.bashrc or close and reopen your SSH session.

Composer

View class-plugin-name-admin.php
<?php
/**
* Plugin Name.
*
* @package Plugin_Name_Admin
* @author Your Name <email@example.com>
* @license GPL-2.0+
* @link http://example.com
* @copyright 2013 Your Name or Company Name
*/
@grappler
grappler / hide-view.php
Last active Sep 29, 2019
Here is how to remove the "view" button from all three locations for a custom post type.
View hide-view.php
<?php
/**
* Hides the 'view' button in the post edit page
*
*/
function hv_hide_view_button() {
$current_screen = get_current_screen();
View result-embed-responsively.html
<style>
.embed-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
max-width: 100%;
height: auto;
}
View Responsive HTML5 Video.css
video {
width: 100%;
max-width: 100%;
height: auto;
}
@grappler
grappler / woocommerce-show-products-ids.php
Created Sep 20, 2018 — forked from corsonr/gist:5947181
Show WooCommerce product ID in a custom column on products list page
View woocommerce-show-products-ids.php
<?php
/**
* Plugin Name: WooCommerce - Show products IDs
* Plugin URI: http://www.remicorson.com/easily-find-woocommerce-products-id/
* Description: Adds a new columns to products list page to display product IDs
* Version: 1.0
* Author: Remi Corson
* Author URI: http://remicorson.com
* Requires at least: 3.5
* Tested up to: 3.5
@grappler
grappler / disable-classic-editor.php
Created May 9, 2018
Remove all traces of the classic editor in Gutenberg
View disable-classic-editor.php
<?php
/**
* Removes the classic editor actions links.
*/
add_action( 'admin_init', function() {
// For hierarchical post types.
add_filter( 'page_row_actions', 'gutenberg_remove_classic_editor_links', 10, 2 );
// For non-hierarchical post types.
add_filter( 'post_row_actions', 'gutenberg_remove_classic_editor_links', 10, 2 );