Skip to content

Instantly share code, notes, and snippets.

View grammar.js
// Helper functions
// A list consists of any number of 'rule', separated by separator, and the last one is optional.
const list = (rule, separator) => seq(rule, repeat(seq(separator, rule)))
const NL = choice("\r\n", "\r", "\n")
const NLOPT = prec(-1, repeat(NL))
// in ascending order of precedence
const operator_table = [
@fwip
fwip / confetti.p8
Created Jul 27, 2019
an example on how to draw confetti in pico-8
View confetti.p8
function create_confetti()
v=1.4 --initial velocity
size=40
-- the center of the confetti
balloon_x=40
balloon_y=40
for i=1,100 do
local r=rnd(size) -- this is how far out from the center it starts
local n=rnd(1) -- this is the angle it goes at
confetti[i] = {
View parsedef.go
package locale
import (
"bufio"
"fmt"
"io"
"regexp"
"strconv"
"strings"
"unicode/utf8"
View main.go
package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
)
View search.py
#!/usr/bin/env python3
from Bio import SeqIO
from collections import defaultdict
import time
M = 7
Q = 10
View gist:5741f0e8982a26d0cd5ea9f1eadbafd4
#!/bin/bash
for fastq in $SAMPLE_NAME*.fastq.gz; do
zcat $fastq \
| awk '/Y/' \
`basename $fastq .gz` >filtered_
done
View reservoir_sampling.cpp
#include <iostream>
#include <vector>
#include <random>
std::random_device rd;
std::mt19937 rng(rd());
const int ITERATIONS = 300;
const int IN_SIZE = 1000000;
View 10_fragment_layout.txt
# Normal layout of a healthy read-pair.
fragment ========================================
fragment + adaptors ~~~========================================~~~
SE read --------->
PE reads R1---------> <---------R2
unknown gap ....................
View double_port_forward.sh
#!/bin/bash
username="MYUSERNAME"
origPort="80"
midlPort="38080"
destPort="80"
midlHost="MYMIDDLEMAN"
destHost="MYDESTINATION"
View run_bcl2fastq.sh
qsub -cwd -N "u-H3MHT" -pe threads 8 -V -S /bin/bash <<'__FASTQ__'
set -x -e -o pipefail
cd "/net/glados/solexa_data/150109_NS500372_0058_AH3MHTBGXX"
bcl2fastq \
--input-dir "/net/glados/solexa_data/150109_NS500372_0058_AH3MHTBGXX/Data/Intensities/BaseCalls" \
--use-bases-mask "y36,I6n,y36" \
--output-dir "/net/glados/solexa_data/150109_NS500372_0058_AH3MHTBGXX/fastq" \