This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This prevents pollution of the global namespace | |
var SQL = (function () { | |
// The Module object: Our interface to the outside world. We import | |
// and export values on it. There are various ways Module can be used: | |
// 1. Not defined. We create it here | |
// 2. A function parameter, function(Module) { ..generated code.. } | |
// 3. pre-run appended it, var Module = {}; ..generated code.. | |
// 4. External script tag defines var Module. | |
// We need to check if Module already exists (e.g. case 3 above). | |
// Substitution will be replaced with actual code on later stage of the build, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Used in the dev console to swap the studnets names from Last, First | |
* to First Last in a BYUI pictroal class list. | |
*/ | |
var names = document.querySelectorAll('#classListTable tr td'); | |
var tmp; | |
for( var x = 0; x < names.length; x++ ){ | |
tmp = names[x].lastElementChild.innerHTML; | |
tmp = tmp.split(', '); | |
tmp = tmp[1] + ' ' + tmp[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Loop through a table and pull out certain cells of data. | |
* | |
* This loops through a the rows of a table and grabs the requested cell(s) from each row. | |
* Cell data is seperated with tabs when multiple cells of data are requested OR with the | |
* combine flag set to true the data will be combined into a single string per row. | |
* | |
* Version: Alpha | |
* | |
* @param {int} id The value of the tables HTML id attribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Attempt to find the message list on this page. | |
var msgList = document.querySelector('#content .message-list .messages'); | |
var scroller = document.querySelector('#content .message-list-scroller'); | |
// If the list was found continue. | |
if( msgList && scroller ){ | |
console.log('Active.') | |
var li = document.createElement('LI'); | |
li.id = 'controls' | |
var html = '<label>Ignore last <input type="text" id="days" style="display:inline-block;"> days.</label><br>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run common docker-compose commands from any sub-directory of a docker project | |
dockcmd(){ | |
# Versions | |
local dockcmd_version="1.5.0" | |
local docker_version=$(docker --version | egrep -o "([0-9]{1,}\.)+[0-9]{1,}") | |
local dcompose_version=$(docker-compose --version | egrep -o "([0-9]{1,}\.)+[0-9]{1,}") | |
# Assign arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opkg update | |
opkg install fdisk | |
BOOT="$(sed -n -e "/\s\/boot\s.*$/{s///p;q}" /etc/mtab)" | |
DISK="${BOOT%%[0-9]*}" | |
PART="$((${BOOT##*[^0-9]}+1))" | |
ROOT="${DISK}${PART}" | |
OFFS="$(fdisk ${DISK} -l -o device,start | sed -n -e "\|^${ROOT}\s*|s///p")" | |
echo -e "p\nd\n${PART}\nn\np\n${PART}\n${OFFS}\n\nn\np\nw" | fdisk ${DISK} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opkg update | |
opkg install lsblk | |
BOOT="$(sed -n -e "/\s\/boot\s.*$/{s///p;q}" /etc/mtab)" | |
DISK="${BOOT%%[0-9]*}" | |
PART="$((${BOOT##*[^0-9]}+1))" | |
ROOT="${DISK}${PART}" | |
UUID="$(lsblk -n -o PARTUUID ${ROOT})" | |
sed -i -r -e "s|(PARTUUID=)\S+|\1${UUID}|g" /boot/grub/grub.cfg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opkg update | |
opkg install losetup resize2fs | |
BOOT="$(sed -n -e "/\s\/boot\s.*$/{s///p;q}" /etc/mtab)" | |
DISK="${BOOT%%[0-9]*}" | |
PART="$((${BOOT##*[^0-9]}+1))" | |
ROOT="${DISK}${PART}" | |
LOOP="$(losetup -f)" | |
losetup ${LOOP} ${ROOT} | |
fsck.ext4 -y ${LOOP} | |
resize2fs ${LOOP} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds a global constant class that ES6 classes can register themselves with. | |
* This is useful for referencing dynamically named classes and instances | |
* where you may need to instantiate different extended classes. | |
* | |
* NOTE: This script should be called as soon as possible, preferably before all | |
* other scripts on a page. | |
* | |
* @class Classes | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// If your PHP version is < 8 | |
if ( ! function_exists( 'str_contains' ) ) { | |
/** | |
* Based on original work from the PHP Laravel framework. | |
* | |
* @author scm6079 | |
* @link https://www.php.net/manual/en/function.str-contains.php#125977 Original Source | |
* |
OlderNewer