Skip to content

Instantly share code, notes, and snippets.

View stormvirux's full-sized avatar
👨‍💻
Working

Muhammed Thaha stormvirux

👨‍💻
Working
View GitHub Profile
@StevenACoffman
StevenACoffman / notes-testing.md
Last active August 4, 2025 15:39
HTTP testing in Go

Goal: Less Badness

  • Enable Quality
  • Enable Maintenance
  • Enable Validation

Testing Terms

  • Stub - an object that provides predefined answers to method calls.
  • Mock - an object on which you set expectations.
  • Fake - an object with limited capabilities (for the purposes of testing), e.g. a fake web service.
@Eun
Eun / database.go
Last active March 10, 2025 12:29
testcontainers-go with postgres
// usage:
// testDB := testhelpers.NewTestDatabase(t)
// defer testDB.Close(t)
// println(testDB.ConnectionString(t))
package testhelpers
import (
"context"
"fmt"
"testing"
# Use Google Cloud Platform stackdriver with python structlog
from google.cloud.logging import Client
from google.cloud.logging import _helpers
from google.cloud.logging.handlers import CloudLoggingHandler
from google.cloud.logging.handlers.transports.background_thread import _Worker
# pip install python-json-logger
from pythonjsonlogger import jsonlogger
@aliparsai
aliparsai / comment-cleanup.sh
Last active May 30, 2022 12:01
Remove comments from Latex files
#!/bin/bash
## Clean-up Comments from Latex Source Files
## Copyright (c) 2020 Ali Parsai ali@parsai.net
##
## Dependencies: sponge from moreutils, latexpand, sed, cat, mv, date, cp
##
## CAUTION: Use version control or backup your files before using this script.
##
## How to use: comment-cleanup.sh TEX_FILE(S)
@jinyu121
jinyu121 / coco_to_voc.py
Last active April 27, 2023 02:26
Convert COCO to VOC
import json
import os
from tqdm import tqdm
from xmltodict import unparse
# BBOX_OFFSET: Switch between 0-based and 1-based bbox.
# The COCO dataset is in 0-based format, while the VOC dataset is 1-based.
# To keep 0-based, set it to 0. To convert to 1-based, set it to 1.
BBOX_OFFSET = 0
@vincent732
vincent732 / parse_lmdb.py
Last active May 28, 2019 15:00
[Caffe] read AnnotatedDatum from LMDB file
# -*- coding: utf-8 -*
import caffe
import lmdb
import numpy as np
import cv2
from caffe.proto import caffe_pb2
import sys
lmdb_env = lmdb.open(sys.argv[-1], map_size=int(1e9))
@nikitametha
nikitametha / installing_caffe.md
Last active June 4, 2025 16:15
Installing Caffe on Ubuntu 16.04 and above (CPU ONLY, WITHOUT CUDA OR GPU SUPPORT)

This is a guide on how to install Caffe for Ubuntu 16.04 and above, without GPU support (No CUDA required).

Prerequisites:

OpenCV

sudo apt-get install libopencv-dev python-opencv

OpenBLAS OR Atlas

@svaksha
svaksha / pythontojulia.md
Created May 12, 2017 12:27 — forked from cuckookernel/pythontojulia.md
Python to Julia Quick translation / conversion reference Guide

A quick and dirty syntax translation / conversion reference guide to ease the transition between Python and Julia. This is not meant as a reference to the language. For that you should read the manual.

Some important differences

  • Arrays in Julia are indexed starting from 1.
  • In Julia classes (i.e. types) don't own methods. Methods are implementations of generic functions and are invoked in a "static style", i.e. instead of Python's str1.rstrip(), we will have rstrip( str1 ), instead of file1.close(), close( file1 ).

Some important similarities.

@geeanlooca
geeanlooca / error-bars-nth-point.tex
Last active July 30, 2021 08:13
Plotting error bars every n-th data point with pgfplots in LaTeX
\documentclass[tikz,preview, border=5mm]{standalone}
\usepackage{tikz,pgfplots,filecontents}
\pgfplotsset{compat=1.7}
%%% Code for "every nth mark" starts here...
\newcounter{marknumber}
\pgfplotsset{
error bars/every nth mark/.style={
/pgfplots/error bars/draw error bar/.prefix code={
@HaleTom
HaleTom / print256colours.sh
Last active August 31, 2025 22:10
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256