Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
bryanwillis / studio-t-measure-formula-history.php
Created March 2, 2024 16:44
Code to add measurement and formula history
<?php
/** Studio T Formula History and Measurement History **/
function bw_custom_user_profile_fields( $user ) {
echo '<h3 class="heading">Salon Customer Data</h3>';
?>
<table class="form-table">
<tr>
<th><label for="_sln_bformula">Formula History</label></th>
<td>
@bryanwillis
bryanwillis / great-lakes-golf-shootout.markdown
Created November 1, 2023 23:34
Great Lakes Golf Shootout
<?php
// This will need to use code/variables from here...
// https://gist.github.com/bryanwillis/5c1c4f5ce5a4294ea35c689e3c975a78#file-results-php-L230-L274
// Map Marker positioned above numbers
$result .= '<div class="steps-container">';
// Line with numbers
$result .= '<img src="https://assessment.globalcoachcenter.com/you.png" class="mapmark ' . $total_0 . $total_1 . $total_2 . $total_3 . $total_4 . $total_5 . '"><div class="line"></div>';
@bryanwillis
bryanwillis / cornell-and-associates-payments.markdown
Created March 7, 2023 15:02
Cornell and Associates - Payments
function fillFormEmail(){
const input = document.getElementById('team_name-866'); // replace 'id' with id of email field
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString); //parse the query string
const teamname = urlParams.get('team'); // Store the parsed email address in variable
input.value = teamname; // fill the form with the email address
}
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html class="wp-toolbar"
lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Edit Page &lsaquo; Candid Solutions &#8212; WordPress</title>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!=='undefined')jQuery(document).ready(func);else if(typeof wpOnload!=='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '/wp-admin/admin-ajax.php',
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer
@bryanwillis
bryanwillis / custom_progress_bar.php
Created October 23, 2019 21:54 — forked from jwahlin/custom_progress_bar.php
Combine Formidable stats with SKT Skillset shortcode
add_shortcode( 'custom_progress_bar', 'add_custom_progress_bar' );
function add_custom_progress_bar( $atts ) {
if (
! isset( $atts['user'] ) || ! isset( $atts['goal'] ) || ! isset( $atts['year_month'] )
|| ! isset( $atts['title'] ) || ! isset( $atts['goal_id'] )
) {
return '';
}
// Get total amount completed for the current month
function recordNavigation() {
var next = $("#detailNext"),
prev = $("#detailPrevious"),
back = $("#backArrowDV img");
next.hasClass("disabled") && next.is(":visible") ? next.trigger("click") : prev.hasClass("disabled") && prev.is(":visible") ? prev.trigger("click") : back.trigger("click")
}
function validateVariableGroup() {
var label = $("#cVarCgroupName_label").text(),
check = emptyCheck("cVarCgroupName", label);
return check
Which code do you write if you want to use type inference on a variable x with the value 3? (TypeScript - 30 sec)
a. let x = 3; ***
b. let x: any = 3;
c. let x: dynamic = 3;
d. let x: number = 3;
A function has to return a string. How can you ensure that it does? (TypeScript - 25 seconds)
a. By adding "<string>" behind the return statement