Skip to content

Instantly share code, notes, and snippets.

View gcman105's full-sized avatar

Gary Cheeseman gcman105

View GitHub Profile
@gcman105
gcman105 / init.vim
Last active July 21, 2017 11:08
gcman105's Neovim init file
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
"-----------------------------------------------------------------------------
" vim-plug plugins {{{1
"-----------------------------------------------------------------------------
" Make sure you use single quotes
call plug#begin('~/.vim/plugged')
@gcman105
gcman105 / TrueColour.md
Created July 20, 2017 18:51 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@gcman105
gcman105 / settings.json
Last active July 1, 2017 19:07
VScode settings
// Place your settings in this file to overwrite the default settings
{
// "vim.insertModeKeyBindings": [{
// "before": ["j", "j"],
// "after": ["<Esc>"]
// }],
// "vim.useCtrlKeys": true,
"workbench.iconTheme": "vscode-icons",
"typescript.npm": "/Users/gcman105/.nvm/versions/node/v8.1.3/bin/npm",
@gcman105
gcman105 / settings.json
Created February 2, 2017 17:07
VScode settings.json
// Place your settings in this file to overwrite the default settings
{
"editor.fontFamily": "Input Mono, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 11,
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
}
]
@gcman105
gcman105 / genesis-image-wrap.php
Created October 19, 2016 09:17
Warp a DIV around img tags for styling
<?php
//do not copy above opening php tag when pasting into a functions.php file
//* Remove default post image
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
//* Add wrapped post image
add_action( 'genesis_entry_content', 'dynamik_wrapped_featured_image', 8 );
function dynamik_wrapped_featured_image() {
if ( is_singular() || ! genesis_get_option( 'content_archive_thumbnail' ) )
@gcman105
gcman105 / woocommerce-genesis-child-remove-sidebars.php
Created October 19, 2016 07:25
Remove sidebars from woocommerce on genesis childthemes
<?php
//do not copy above opening php tag when pasting into a functions.php file
//Full Width Pages on WooCommerce
function themeprefix_cpt_layout() {
if( is_page ( array( 'cart', 'checkout' )) || is_shop() || 'product' == get_post_type() ) {
return 'full-width-content';
}
}
add_filter( 'genesis_site_layout', 'themeprefix_cpt_layout' );
@gcman105
gcman105 / AQL4B.html
Last active September 5, 2016 09:46
Add Amazon Quick Linker to your Blog
<a type=amzn >Harry Potter</a>
<!-- Links to Amazon.co.uk search results page for Harry Potter. -->
<a type=amzn search="Harry Potter">My favourite hero</a>
<!-- The link reads My favourite hero and points to a search results page for the phrase Harry Potter. -->
<a type=amzn search="Harry Potter" category="books">My favourite hero</a>
<!-- Links to a search results page for the phrase Harry Potter, but only in the Books category. -->
<!-- View a list of valid Amazon.co.uk category attributes -->
<a type=amzn asin="B000012345">I love this item</a>
<!-- The link reads I love this item and links directly to the specific Amazon product with Amazon id (ASIN) B000012345 -->
@gcman105
gcman105 / Google Tag Manager on Genesis Framework
Last active August 29, 2015 14:21 — forked from anandkumar/GTM on Genesis Framework
Add Google Tag Manager script to a Genesis Framework Child Theme
/**
* Add Google Tag Manager script to a Genesis Framework Child Theme
*
* @author Gary Cheeseman (Forked from Anand Kumar)
* @link http://www.garycheeseman.me.uk/
*
*/
add_action('genesis_before', 'google_tag_manager');
function google_tag_manager() { ?>
@gcman105
gcman105 / Preferences_sublime-settings.json
Created April 26, 2015 18:59
Preferences.sublime-settings
{
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/User/SublimeLinter/Seti (SL).tmTheme",
"font_face": "Input Mono",
"font_size": 9,
"highlight_line": true,
"ignored_packages":
[
# argument is a set of non-required options.
config.vm.synced_folder "./vagrant_data/html/", "/usr/share/nginx/html/"
# Example for VirtualBox:
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = false
# Customize the amount of memory on the VM:
vb.memory = "1024"