Skip to content

Instantly share code, notes, and snippets.

View new-result.php
<?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>';
View ICBI-prefill-team.js
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
}
View wp-malware.html
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',
View install-chrome.cmd
$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
View custom_progress_bar.php
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
View zcrm6.js
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
View TypeScript
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
View query-dropdown-ff.php
add_filter(frm_setup_new_fields_vars, frm_populate_member, 20, 2);
add_filter(frm_setup_edit_fields_vars, frm_populate_member, 20, 2); //use this function on edit too
function frm_populate_member($values, $field){
if($field->id == 732 || $field->id == 733){ //replace 732 and 733 with the IDs of the fields to populate
global $wpdb;
//the Query
$the_Result = $wpdb->get_results( "SELECT concat_ws(', ', last_name, first_name) as display_name FROM wp_database.wp_wp_eMember_members_tbl where account_state = 'active' order by last_name, first_name;" );
unset($values['options']); //break the binding of any existing content in the values array