- Not all times when we have a
Team
will we want a list ofUser
's or, approvers - When we select
UserApprover
entries we want it to be per-team wheredeleted
isFalse
- When we select
FinancialApprover
entries we want it to be per-team wheredeleted
isFalse
- We may wish to select both
UserApprover
andFinancialApprover
entries for aTeam
This file contains 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 | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi | |
ADAPTER="eth0" | |
# Allow overriding from eth0 by passing in a single argument |
This file contains 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 | |
return [ | |
[ "Angola", "AO" ], | |
[ "Antigua and Barbuda", "AG" ], | |
[ "Aruba", "AW" ], | |
[ "Bahamas", "BS" ], | |
[ "Belize", "BZ" ], | |
[ "Benin", "BJ" ], | |
[ "Botswana", "BW" ], |
This file contains 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
module.exports = { | |
run(context) { | |
return context.runWithDriver((driver) => { | |
return driver.get(context.options.loginUrl) | |
.then(() => { | |
const webdriver = context.webdriver; | |
const until = webdriver.until; | |
const By = webdriver.By; | |
const userName = context.options.username || 'admin'; |
This file contains 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
(function(target, threshold, elem) { | |
listener = () => { | |
if (target.scrollY > threshold) { | |
elem.style.opacity = 1; | |
} else { | |
elem.style.opacity = 0; | |
} | |
}; | |
target.addEventListener( | |
'scroll', |
This file contains 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/python | |
""" | |
This utility allows you to count the number of lines in files | |
by default just .py files, but accepts command-line arguments. | |
This utility does miss files and folders beginning with '.' | |
so don't use them! | |
usage: {script} {path} [extensions] [exclude] |
This file contains 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
# | |
# Find the JEMALLOC client includes and library | |
# | |
# This module defines | |
# JEMALLOC_INCLUDE_DIR, where to find jemalloc.h | |
# JEMALLOC_LIBRARIES, the libraries to link against | |
# JEMALLOC_FOUND, if false, you cannot build anything that requires JEMALLOC | |
# also defined, but not for general use are |
This file contains 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 | |
/* | |
Plugin Name: CODESIGN2 Media Taxonomy Modifications | |
Plugin URI: http://www.codesign2.co.uk | |
Description: We think it's a real shame that media can be a little unweildy, and not make much sense; on larger sites it's debilitating, so we made this plugin. Enjoy | |
Author: CODESIGN2 | |
Version: 1.3.6 | |
Author URI: http://www.codesign2.co.uk/ | |
*/ |
This file contains 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
var array = []; | |
function closest(array,num){ | |
var i=0; | |
var minDiff=1000; | |
var ans; | |
for(i in array){ | |
var m=Math.abs(num-array[i]); | |
if(m<minDiff){ | |
minDiff=m; |