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
{ cat <<EOF | |
aws s3 ls s3://bucket/prefix1 | |
aws s3 ls s3://bucket/prefix2 | |
aws s3 ls s3://bucket/prefix3 | |
EOF | |
} | xargs -I{} -P 10 bash -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
params.filter_seqs = 'NO_FILTER' | |
filter_file = file(params.filter_seqs) | |
process foo { | |
input: | |
file filter_file | |
script: | |
def filter_argument = filter_file.name != 'NO_FILTER' ? "--filter ${params.filter_seqs}" : '' |
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
params.filter_seqs = 'NO_FILTER' | |
filter_file = file(params.filter_seqs) | |
process foo { | |
input: | |
file filter_file | |
script: | |
def filter_argument = filter_file.name != 'NO_FILTER' ? "--filter ${params.filter_seqs}" : '' |
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
# | |
# generate 01compositional.bed.gz | |
# | |
# low-complexity by mDUST | |
mdust hs37d5.fa -c -w7 -v28 \ | |
| hs37d5.mdust-w7-v28.txt \ | |
| cut -f1,3,4 \ | |
| gawk -vOFS="\t" '{--$2;print}' \ | |
| bgzip > 01compositional/hs37d5.mdust-w7-v28.bed.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
public class Generics { | |
void wildcard() { | |
List<?> stuff = new ArrayList<>(); | |
stuff.add("xx"); // NOT ok | |
stuff.add(new Object()); // NOT ok | |
stuff.size(); // OK | |
List<?> a = new ArrayList<Object>(); // OK | |
List<?> b = new ArrayList<String>(); // OK |
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 | |
# | |
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe | |
# mounted at /mnt. It should be run early on the first boot of the system. | |
# | |
# Beware, This script is NOT fully idempotent. | |
# | |
METADATA_URL_BASE="http://169.254.169.254/2012-01-12" | |
yum -y -d0 install mdadm curl |
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
import java.nio.channels.FileLock | |
final file = new RandomAccessFile(new File("foo.lock"), "rw") | |
println "<Entering in critical section>" | |
try { | |
/* | |
* wait to acquire a lock | |
*/ | |
def secs = 0 | |
FileLock lock |
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 NextFlow logo as this file. |
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
// define a grammar called Hello | |
grammar Hello; | |
r : 'hello' ID; | |
ID : [a-z]+ ; | |
WS : [ \t\r\n]+ -> skip ; |
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
spinner() | |
{ | |
local pid=$1 | |
local delay=0.75 | |
local spinstr='|/-\' | |
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do | |
local temp=${spinstr#?} | |
printf " [%c] " "$spinstr" | |
local spinstr=$temp${spinstr%"$temp"} | |
sleep $delay |