Skip to content

Instantly share code, notes, and snippets.

Avatar
🏔️
Exploring

Brandon Herford BrandonDH

🏔️
Exploring
View GitHub Profile
View test.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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">
<?php
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
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
<?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
BrandonDH / list_sort.py
Created Feb 5, 2018
Python program that sorts a lists of temperatures input by the user and returns the highest one.
View list_sort.py
# 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.