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
/*! | |
* jQuery.hasClasses plugin | |
* | |
* Check if an element has ALL classes | |
* or ANY of a number of classes | |
* | |
* usage: | |
* $('#el-id').hasClasses('foo || bar') <- has EITHER 'foo' or 'bar' | |
* $('#el-id').hasClasses('|| foo bar') <- has EITHER 'foo' or 'bar' | |
* $('#el-id').hasClasses('any: foo bar') <- has EITHER 'foo' or 'bar' |
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
/*! | |
* Global general-purpose JavaScript convenience | |
* utlity helper functions (verbosity intentional) | |
* | |
* Some of these functions are taken straight from | |
* other libraries and put in the global scope here. | |
* Is that a good idea? Maybe, maybe not. | |
*/ | |
// Avoid console errors in browsers that lack a console. |
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
# save this to 'xnat_vagrant/configs/xnat17dev' and rename 'custom.yaml' | |
# make sure 'revision' is set to '1.7' for the setup script | |
revision: '1.7' | |
# use an archive of XNAT 1.7 from the NRG FTP server | |
xnat_src: 'ftp://ftp.nrg.wustl.edu/pub/xnat/nrg-xnat_builder_1_7dev-94504f3c6496.tar.gz' |
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
/** | |
* UMD pattern with anonymous function expression | |
*/ | |
(function(){ | |
var umd = function(factory){ | |
if (typeof exports === 'object') { | |
return module.exports = factory(); | |
} | |
else if (typeof define === 'function' && define.amd) { |
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
#!/usr/bin/env bash | |
# This script will iterate through the arguments passed to it and collect | |
# a list of commands and variables to execute in a specified order. | |
# Example usage: | |
# =================================================================================== | |
# ./parse-args.sh -ktdbyr --name=foo | |
# ...or... | |
# ./parse-args.sh --name=foo --backup --reset --delete --build --deploy --restart |
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
#!/usr/bin/env bash | |
# This script will iterate through the arguments passed to it and collect | |
# a list of commands and variables to execute in a specified order. | |
# It differs from the 'parse-args.sh' script in that it sets variables | |
# instead of building up a string of commands. | |
# Example usage: | |
# =================================================================================== | |
# ./parse-args-vars.sh -ktdbyr --name=foo |
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 | |
# file path example | |
FILE=/home/user/src.dir/prog.c | |
echo ${FILE#/*/} # ==> user/src.dir/prog.c -- remove everything BEFORE the SECOND '/' | |
echo ${FILE##*/} # ==> prog.c -- remove part BEFORE LAST '/' | |
echo ${FILE%/*} # ==> /home/user/src.dir -- remove everything AFTER the LAST '/' | |
echo ${FILE%%/*} # ==> nil -- remove everything AFTER the FIRST '/' (returns empty string) | |
echo ${FILE%.c} # ==> /home/user/src.dir/prog -- remove everything AFTER '.c' |
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
#!/usr/bin/env bash | |
# This script will parse the arguments passed to it | |
# and execute commands in a specified order. | |
# Example usage: | |
# =================================================================================== | |
# ./parse-args-ez.sh -ktdbyr --name=foo | |
# ...or... | |
# ./parse-args-ez.sh --name=foo --backup --reset --delete --build --deploy --restart |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
require 'json' | |
# arguments: start_dir output_filename file_format | |
# dir=./ name=file-list.json skip=.vagrant,.work | |
$args_obj = {} |
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
#!/usr/bin/env groovy | |
import groovy.json.* | |
// set to current directory if not specified as the first argument | |
def startPath = args.length >= 1 ? args[0] : '.' | |
// rewrite startPath to current directory if necessary | |
if ((startPath =~ /^(\.|\.\/)$/).matches()) { | |
startPath = '../' + (new File(new File(startPath).canonicalPath)).name |
OlderNewer