Skip to content

Instantly share code, notes, and snippets.

View MonteLogic's full-sized avatar
♂️

Monte Logic MonteLogic

♂️
View GitHub Profile
@MonteLogic
MonteLogic / settings-04.08.2024.json
Last active September 15, 2024 16:17
settings[object Object]
{
"git.enableSmartCommit": true,
"git.confirmSync": false,
"git.autofetch": true,
"editor.minimap.enabled": false,
"intelephense.stubs": [
"apache",
"bcmath",
"bz2",
"calendar",
@MonteLogic
MonteLogic / cb-roadmap.md
Last active September 21, 2024 13:41
Contractor Bud Writing

Contractor Bud Roadmap

We need to get the scheduling done good and then write docs, then release and then work on the other features.

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)
@MonteLogic
MonteLogic / block.json
Last active September 16, 2022 15:52 — forked from ryanwelcher/block.json
{
"$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": {
@benevidesh
benevidesh / zn
Last active March 12, 2024 16:10
Zettelkasten Workflow (WIP)
#!/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 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,
@jessepearson
jessepearson / rewrite-wc-bookings-get-time-slots-html.php
Last active August 7, 2023 14:48
Make it so that all time slots in a time-based booking in WooCommerce Bookings shows how many spots remain, not just partially booked blocks.
<?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>';
}
@zhangpengGenedock
zhangpengGenedock / git clone specific commit branch
Created October 19, 2017 03:52
git clone specific commit branch
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?
@anttiviljami
anttiviljami / wp-admin-modal-dialog.php
Last active May 22, 2024 13:05
WordPress admin modal dialog example
<?php
// enqueue these scripts and styles before admin_head
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
wp_enqueue_style( 'wp-jquery-ui-dialog' );
?>
<!-- The modal / dialog box, hidden somewhere near the footer -->
<div id="my-dialog" class="hidden" style="max-width:800px">
<h3>Dialog content</h3>
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p>
@drpventura
drpventura / Student.cpp
Last active March 28, 2023 04:24
Student class moved to separate .h and .cpp files. See video at https://youtu.be/gyA7uDlazkc.
#include "Student.h"
using namespace std;
Student::Student(string theName, double theGpa) : name(theName), gpa(-1) {
set_gpa(theGpa);
}
// accessor