Skip to content

Instantly share code, notes, and snippets.

View brettvanderwerff's full-sized avatar
😀

Brett Vanderwerff brettvanderwerff

😀
View GitHub Profile
@elowy01
elowy01 / BCFtools cheat sheet
Last active May 7, 2024 16:51
BCFtools cheat sheet
*bcftools filter
*Filter variants per region (in this example, print out only variants mapped to chr1 and chr2)
qbcftools filter -r1,2 ALL.chip.omni_broad_sanger_combined.20140818.snps.genotypes.hg38.vcf.gz
*printing out info for only 2 samples:
bcftools view -s NA20818,NA20819 filename.vcf.gz
*printing stats only for variants passing the filter:
bcftools view -f PASS filename.vcf.gz
@samukasmk
samukasmk / torrent-client-by-url.py
Last active June 19, 2023 12:26
Script of example to download files by torrent in Python (By: magnet url)
# source:
# https://stackoverflow.com/questions/6051877/loading-magnet-link-using-rasterbar-libtorrent-in-python
#
# ATTENTION: This is only a example of to use a python bind of torrent library in Python for educational purposes.
# I am not responsible for your download of illegal content or without permission.
# Please respect the laws license permits of your country.
import libtorrent as lt
import time
@elementzonline
elementzonline / ipcam.py
Created March 19, 2017 04:35 — forked from shihyuan/ipcam.py
Stream Video with OpenCV in Python from an Android running IP Webcam
# Stream Video with OpenCV from an Android running IP Webcam (https://play.google.com/store/apps/details?id=com.pas.webcam)
# Code Adopted from http://stackoverflow.com/questions/21702477/how-to-parse-mjpeg-http-stream-from-ip-camera
import cv2
import urllib2
import numpy as np
import sys
host = "192.168.0.220:8080"
if len(sys.argv)>1:
@wojteklu
wojteklu / clean_code.md
Last active May 11, 2024 05:46
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

anonymous
anonymous / script.py
Created November 3, 2015 11:47
import cv2
import numpy as np
def get_frame_averages(video_path):
vc = cv2.VideoCapture(video)
if vc.isOpened():
rval, frame = vc.read()
else:
Alice's Adventures in Wonderland
ALICE'S ADVENTURES IN WONDERLAND
Lewis Carroll
THE MILLENNIUM FULCRUM EDITION 3.0