This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| mkdir -p ./backgrounds | |
| function get_google_device_art { | |
| local device=$1 | |
| # Get the Google Device backgrounds | |
| curl "https://developer.android.com/distribute/marketing-tools/device-art-resources/$1/port_back.png" > "./backgrounds/$1_port_back.png" | |
| curl "https://developer.android.com/distribute/marketing-tools/device-art-resources/$1/port_fore.png" > "./backgrounds/$1_port_fore.png" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // We are using the WooCommerce Checkout Field Editor plugin in addition to WooCommerce. The Checkout Field Editor | |
| // does a nice job at providing a UI for manage additional fields. But doesn't provide any method to do validations. | |
| // So this code helps with that on a very specific implemention where we have a Gender select and a DoB date selector. | |
| // On the Gender we want to ensure the selected value is 'Male' or 'Female' only. We don't want the | |
| default option 'Choose Option' to be valid. On the DoB we want to enforce the user is 18 or older. | |
| add_action( 'woocommerce_after_checkout_validation', 'woo_checkout_additional_field_validation' ); | |
| function woo_checkout_additional_field_validation() { | |
| if (!defined('WOOCOMMERCE_CHECKOUT')) { | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "https://schemas.wp.org/trunk/block.json", | |
| "apiVersion": 2, | |
| "name": "create-block/mol-custom-blocks", | |
| "version": "0.1.0", | |
| "title": "Monte Logic's Custom Blocks", | |
| "category": "text", | |
| "icon": "flag", | |
| "description": "A Gutenberg block to show your pride! This block enables you to type text and style it with the color font Gilbert from Type with Pride.", | |
| "attributes": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Student.h" | |
| using namespace std; | |
| Student::Student(string theName, double theGpa) : name(theName), gpa(-1) { | |
| set_gpa(theGpa); | |
| } | |
| // accessor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php // do not copy this line | |
| function rewrite_wc_bookings_get_time_slots_html( $block_html, $available_blocks, $blocks ) { | |
| $block_html = ''; | |
| foreach ( $available_blocks as $block => $quantity ) { | |
| if ( $quantity['available'] > 0 ) { | |
| $block_html .= '<li class="block" data-block="' . esc_attr( date( 'Hi', $block ) ) . '"><a href="#" data-value="' . date( 'c', $block ) . '">' . date_i18n( get_option( 'time_format' ), $block ) . ' <small class="booking-spaces-left">(' . sprintf( _n( '%d left', '%d left', $quantity['available'], 'woocommerce-bookings' ), absint( $quantity['available'] ) ) . ')</small></a></li>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| What else can you do? | |
| How to clone repository to a specific commit? (full clone) | |
| # Create empty repository to store your content | |
| git clone <url> | |
| git reset <sha-1> --hard | |
| More info: | |
| How to clone single branch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/bash | |
| # zn - as zettell | |
| # new export variables EDITOR for your editor and | |
| #+ NOTES for your notes folder. | |
| main () { | |
| note_id=$(date +'%Y%m%d%H%M%S') | |
| $EDITOR $NOTES/"$note_id".md | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| ============================================================================== | |
| This file is part of the JUCE examples. | |
| Copyright (c) 2020 - Raw Material Software Limited | |
| The code included in this file is provided under the terms of the ISC license | |
| http://www.isc.org/downloads/software-support-policy/isc-license. Permission | |
| To use, copy, modify, and/or distribute this software for any purpose with or | |
| without fee is hereby granted provided that the above copyright notice and | |
| this permission notice appear in all copies. | |
| THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Useful vim commands: | |
| Insert the date but this date would be in the format of MM/DD/YY | |
| :r !echo -n $(date +\%m/\%d/\%y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "git.enableSmartCommit": true, | |
| "git.confirmSync": false, | |
| "git.autofetch": true, | |
| "editor.minimap.enabled": false, | |
| "intelephense.stubs": [ | |
| "apache", | |
| "bcmath", | |
| "bz2", | |
| "calendar", |
OlderNewer