Skip to content

Instantly share code, notes, and snippets.


Brandon Herford BrandonDH

Block or report user

Report or block BrandonDH

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View amp_dashboard.js
function compareUsers() {
// Get current logged in user
let currentUser = document.getElementById('current-user');
let userToTest = currentUser.innerText;
// Create a list of PMs
let pmList = document.getElementsByTagName('label');
// Iterate through the list
BrandonDH / project_manager.php
Created Mar 25, 2019
Change Bootstrap class based on variable value.
View project_manager.php
<div class="col pt-3 pb-3 alert bg-light mr-3">
if ($total_dash > 500) {
$high_alarm = "text-danger";
} else {
$high_alarm = "text-dark";
<div class="font-weight-regular mb-0 h2 <?php echo $high_alarm ?>"><?php echo $total_dash; ?></div>
<div class="text-dark">Active Alarms</div>
BrandonDH / project_manager_sitecheck_status_view.php
Created Mar 25, 2019
Step and append an integer to an id snippet
View project_manager_sitecheck_status_view.php
// Initialize a counter
$count = 1;
foreach ($project_managers as $key => $value) {
// Create the id for each individual checkbox - stepping +1 on each iteration
$check_id = "customCheck" . $count;
echo '<li class="custom-control custom-checkbox">
<input id="' . $key . '" name=' . $value . ' type="checkbox" class="custom-control-input your-checkbox" checked>
<label class="custom-control-label" for="' . $key . '">' . $value . '</label></li>';
BrandonDH /
Created Feb 5, 2018
Python program that sorts a lists of temperatures input by the user and returns the highest one.
# I wrote this main() to call the highest_temperature function above.
def main():
"""Create a list of temperatures and call a function to find the highest."""
# Initialize the temperature list.
some_temps = ["", "", "", "", "", ""]
# For each index in 'some_temps' get a temperature from the user.
for i in range(len(some_temps)):
some_temps[i] = float(input("Give me a random temperature from the last few weeks: "))
You can’t perform that action at this time.