Skip to content

Instantly share code, notes, and snippets.

View mrbusche's full-sized avatar

Matt Busche mrbusche

View GitHub Profile
@mrbusche
mrbusche / jQuery check_uncheck all
Created October 17, 2019 02:11
jQuery check/uncheck all
$('#checkAll').click(function() {
$('input:checkbox[id^="check_"]').prop('checked', this.checked);
});
@mrbusche
mrbusche / enhanced air yards
Created October 16, 2019 16:14
enhanced air yards
% diff (air yards - rec yards ) / rec yards > 50%
air yards / targets > 10
rec yards / targets
targets > 20
# Description: Boxstarter Script
# Original Author: Jess Frazelle <[email protected]>
# Modifed by Matt Busche
# Last Updated: 9/22/2018
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
@mrbusche
mrbusche / MFL Searching
Last active August 11, 2019 15:38
MFL searching
//option 1
var names = ['Michael, Christine','Allen, Buck','Breida, Matt','Sanu, Mohamed','Ross, John','Gore, Frank'];
function loopNames(names) {
for (var name = 0; name < names.length; name++) {
(function (name) {
setTimeout(function () {
document.getElementById('add_filt_name').value = names[name];
picker_filter('add');
console.log(document.getElementById('add').getElementsByTagName('tbody').length > 0 ? names[name] : '');
@mrbusche
mrbusche / desktop computer
Last active April 7, 2018 14:28
desktop computer boxstarter
# Description: Boxstarter Script
# Original Author: Jess Frazelle <[email protected]>
# Modifed by Matt Busche
# Last Updated: 4/7/2018
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
@mrbusche
mrbusche / numberToRoman.groovy
Created March 6, 2018 02:13
Number to Roman Numeral
String getRomanNumeral(int userEnteredNumber) {
//Numbers that are needed to reduce the complexity of code.
//In some cases the numbers are absolutely necessary (1000, 500, etc)
//but numbers like 990, 490 are added to decrease code complexity
List numbers = [1000, 999, 990, 900, 500, 499, 490, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]
List romanNumerals = ['M','CMXCIX','XM','CM','D','CDXCIX','XD','CD','C','XC','L','XL','X','IX','V','IV','I']
String romanNumeral = ''
int i = 0
while (userEnteredNumber > 0) {
while (userEnteredNumber - numbers[i] >= 0) {
@mrbusche
mrbusche / romanToNumber.groovy
Created March 6, 2018 02:13
Roman Numeral to Number
//no return type specified because it can be an int or a string.
//Generally this would be in a class and an exception would be throw rather than
//returning a string, but a whole class cannot be ran on the Groovy Console
def romanToDecimal(String romanNumber) {
Integer newNumber = 0, previousNumber = 0
Map romanToNumberMapping = [M:1000, D:500, C:100, L:50, X:10, V:5, I:1]
//convert the string to upper case in case the user entered it in lower case
String romanNumeral = romanNumber.toUpperCase()
for (Integer oneChar = romanNumeral.length() - 1; oneChar >= 0; oneChar--) {
String oneLetter = romanNumeral.charAt(oneChar)
@mrbusche
mrbusche / laptop boxstarter
Last active November 28, 2018 16:35
Boxstart Script
# Description: Boxstarter Script
# Original Author: Jess Frazelle <[email protected]>
# Modified by Matt Busche
# Last Updated: 11/28/2018
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
@mrbusche
mrbusche / whereis.txt
Created November 30, 2017 18:48
Where is my git commit
git branch -r --contains {commit}
tells you all of the branches (including remote) that contain a commit
@mrbusche
mrbusche / ApiSecurityConfig.groovy
Created September 18, 2017 02:32 — forked from jeffsheets/ApiSecurityConfig.groovy
Spock Test for Spring Boot Security configuration - showing basic simple examples for unauthenticated users, role based access, and httpBasic logins
@EnableWebSecurity
class ApiSecurityConfig extends WebSecurityConfigurerAdapter {
@Inject
void configureGlobal(AuthenticationManagerBuilder auth) {
auth.inMemoryAuthentication()
.withUser('svc_acct').password('somePassword').roles('FULL_ACCESS')
}
@Override
protected void configure(HttpSecurity http) {