Skip to content

Instantly share code, notes, and snippets.

@jessbudd
jessbudd / os-setup-script.sh
Last active April 9, 2024 08:01
New PC setup bash script
Homebrew
install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
#!/usr/bin/env bash
# Setup script for setting up a new macos machineecho "Starting setup"# install xcode CLI
xcode-select —-install
as at 6/2/2021
// Place your settings in this file to overwrite the default settings
{
"editor.wordWrap": "on",
"workbench.colorTheme": "Monokai",
"git.enableSmartCommit": true,
"git.confirmSync": false,
"workbench.startupEditor": "newUntitledFile",
"explorer.confirmDelete": false,
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/feralfp/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
@jessbudd
jessbudd / VS Code extensions
Last active March 16, 2021 05:45
My VS code extensions for reference
- Prettier
- ESLint
- git lense
- Indent Rainbow
- Monokai Theme
- Text Pastry
- Auto Rename Tag
- Code Spell Checker
- Nunjucks
- :emojisense:
@jessbudd
jessbudd / VS Code snippets
Last active March 16, 2021 05:45
My VS code snippets for reference
{
// logging
"Console log": {
"scope": "javascript,typescript",
"prefix": "cl",
"body": ["console.log($1);", "$2"]
},
"Console table": {
"scope": "javascript,typescript",
"prefix": "ct",
@jessbudd
jessbudd / gist:1a65c1d57a0e017cdb0c945b50ec14a3
Created August 18, 2019 04:41
Move product tabs beside the product image - woocommerce
credit: https://businessbloomer.com/woocommerce-move-product-tabs-short-description/
/**
* @snippet Move product tabs beside the product image - WooCommerce
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055
* @sourcecode https://businessbloomer.com/?p=393
* @author Rodolfo Melogli
* @testedwith WooCommerce 3.5.2
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
Go to Control Panel
Go to PHPMyadmin
Select appropriate Database
Click on SQL in top bar
Enter in below code (change username, password, name and email)
Add this codeblock to your functions.php file:
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
Add html to "Before Header Content" in GP Hooks
<div class="new-site-logo">
<a href="https://hbdsalon.com.au/" title="HBD Salon" rel="home">
<img class="header-image" alt="HBD Salon" src="https://hbdsalon.com.au/wp-content/uploads/2018/02/HBD_Salon_Logo-e1518063893509.jpg" title="HBD Salon" srcset="https://hbdsalon.com.au/wp-content/uploads/2018/02/HBD_Salon_Logo-e1518063893509.jpg 1x, https://hbdsalon.com.au/wp-content/uploads/2018/02/HBD_Salon_Logo_1408.png 2x" width="3508" height="1069">
</a>
</div><!--site-logo-->
<div class="header-contact">
<p class="header-phone">93909387</p>
<a href="#">Book Appointment</a>
Add this code block to php file:
// Add Backorder text to woocommerce images that are backordered products
function ff_add_backorder_badge() {
global $product;
if($product->stock !== '' && $product->stock <= 0) {
echo '<span class="out-of-stock">Backorder</span>';
}
}