Skip to content

Instantly share code, notes, and snippets.

View jayhill90's full-sized avatar

Jay Hill jayhill90

View GitHub Profile
@jayhill90
jayhill90 / launch.json
Created April 17, 2020 17:34
XDebug Configuration file for VSCode and Local by Flywheel
{
// Set your VSCode Workspace root to the root folder of your Local site.
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",

Keybase proof

I hereby claim:

  • I am jayhill90 on github.
  • I am hrvst (https://keybase.io/hrvst) on keybase.
  • I have a public key ASDju9omCbMYfeFwbhYMBuMjLgGSZQ-4KWe41pdxnNQUewo

To claim this, I am signing this object:

@jayhill90
jayhill90 / flac2mp3.sh
Created March 30, 2020 19:56
Convert a folder of flac files to 320kbps mp3
#!/bin/sh
find . -name "*.flac" -exec ffmpeg -i {} -c:a libmp3lame -b:a 320k -map_metadata 0 -id3v2_version 3 {}.mp3 \;
@jayhill90
jayhill90 / webpack.config.js
Created November 13, 2019 13:56
A basic webpack config file for WordPress themes to compile JS, SCSS and Font files
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
entry: ['./src/js/index.js', './src/scss/index.scss'],
output: {
filename: './build/js/index.js',
path: path.resolve(__dirname),
},
module: {
@jayhill90
jayhill90 / get-region-by-country-name.php
Last active October 20, 2019 02:22
Get region of EMEA, NA, ANZ, or Other by Country Name
<?php
function get_region($country_name) {
$array = array(
'AF' => array(
'country' => 'Afghanistan',
'continent' => 'AS',
),
'AX' => array(
'country' => 'Åland Islands',
'continent' => 'EU',
@jayhill90
jayhill90 / center-flex-divs.css
Last active August 26, 2019 15:06
Center divs with auto margins for container div.
.container {
margin-left: auto;
margin-right: auto;
position: relative;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.item {
@jayhill90
jayhill90 / latest-posts.php
Created August 24, 2019 21:32
Latest Posts block based on core/latest-posts
<?php
namespace Jay\Blocks\LatestPosts;
/**
* Renders the `jay/latest-posts` block on server.
*
* @param array $attributes The block attributes.
*
* @return string Returns the post content with latest posts added.
*/
@jayhill90
jayhill90 / modify-genesis-copyright.php
Created July 29, 2018 13:03
Modify the copyright information in a Genesis child theme