Skip to content

Instantly share code, notes, and snippets.

View no2pixel's full-sized avatar

Quentin Cole no2pixel

View GitHub Profile
@daneden
daneden / Instructions.md
Created December 1, 2015 00:25
Remap Caps Lock to Emoji on Mac

How to remap the caps lock key to the emoji selector on Mac

  1. Go to System Preferences -> Keyboard -> Modifier Keys...
  2. Change “Caps Lock” to “No action”
  3. Install Seil
  4. Change the Caps Lock key in Seil to keyCode 80 (F19)
  5. Install Karabiner
  6. Open Karabiner and go to Misc & Uninstall -> Open private.xml
  7. Copy the contents of this gist's example to the XML file and save
  8. In Karabiner, go to Change Keys -> Reload XML
@scottopolis
scottopolis / wp-api-custom-taxonomies.php
Created October 27, 2015 22:27
Add custom taxonomies to the WP-API
<?php
function ms_add_tax_to_api() {
$taxonomies = get_taxonomies( '', 'objects' );
foreach( $taxonomies as $taxonomy ) {
$taxonomy->show_in_rest = true;
}
}
add_action( 'init', 'ms_add_tax_to_api', 30 );
@Lewiscowles1986
Lewiscowles1986 / lc-svg-upload.php
Last active August 4, 2016 13:45
SVG Media Plugin for WordPress (Works since 4.1.2!)
<?php
// Please see https://github.com/Lewiscowles1986/WordPressSVGPlugin from now on
@paulgv
paulgv / vimeoPutUpload.html.twig
Last active November 12, 2020 17:58
This is a basic example of how to perform a PUT upload using jQuery.fileupload and Vimeo's API https://developer.vimeo.com/api/upload#http-put-uploading
<script type="text/javascript" src="{{ asset('jquery.fileupload/js/vendor/jquery.ui.widget.js') }}"></script>
<script type="text/javascript" src="{{ asset('jquery.fileupload/js/jquery.iframe-transport.js') }}"></script>
<script type="text/javascript" src="{{ asset('jquery.fileupload/js/jquery.fileupload.js') }}"></script>
<script src="{{ asset('bundles/fosjsrouting/js/router.js') }}"></script>
<script src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script>
<script type="text/javascript">
$(document).on('change', '.btn-file :file', function() {
var input = $(this),
numFiles = input.get(0).files ? input.get(0).files.length : 1,
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active January 8, 2024 13:24
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@brasofilo
brasofilo / wpse_76593.php
Last active August 17, 2017 11:38
Hide wp-content/themes path
<?php
// REMOVE WP-CONTENT
// Rewrites DO NOT happen for child themes
// Add .htaccess rewrite rules to convert urls
// like "http://example.com/wp-content/themes/theme-name/path" into "http://example.com/path"
/*
in case your wordpress is in a folder,
and you change the site_url to the root of the domain,
add the folder name in lines 29 to 34,