Skip to content

Instantly share code, notes, and snippets.

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

Muhammed Thaha stormvirux

👨‍💻
Working
View GitHub Profile
@stormvirux
stormvirux / database.go
Created August 2, 2024 08:09 — forked from Eun/database.go
testcontainers-go with postgres
// usage:
// testDB := testhelpers.NewTestDatabase(t)
// defer testDB.Close(t)
// println(testDB.ConnectionString(t))
package testhelpers
import (
"context"
"fmt"
"testing"
@stormvirux
stormvirux / script
Created August 17, 2023 12:28 — forked from fesor/script
Jenkins: script for checking is directory has changed from last build
#!/bin/bash
DIR_PATH=$1
if [ ! -d "$DIR_PATH" ]; then
echo "Directory '$DIR_PATH' not exists"
exit 1
fi
if [ -z "$GIT_COMMIT" ]; then
echo "No current commit... fail"
@stormvirux
stormvirux / comment-cleanup.sh
Last active May 30, 2022 12:03 — forked from aliparsai/comment-cleanup.sh
Remove comments from Latex files
#!/bin/bash
## Clean-up Comments from Latex Source Files
## Copyright (c) 2020 Ali Parsai [email protected]
## Copyright (c) 2021 Thaha Mohammed
##
## Dependencies: sponge from moreutils, latexpand, sed, cat, mv, date, cp
##
## CAUTION: Use version control or backup your files before using this script.
##
@stormvirux
stormvirux / error-bars-nth-point.tex
Created July 30, 2021 08:13 — forked from geeanlooca/error-bars-nth-point.tex
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={

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@stormvirux
stormvirux / pythontojulia.md
Created January 2, 2020 10:52 — forked from svaksha/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.

@stormvirux
stormvirux / report-template.tex
Created December 29, 2019 12:38 — forked from pluskid/report-template.tex
A LaTeX template that I use for writing notes and reports.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Use the koma-script document style
\documentclass{scrbook}
\KOMAoptions{twoside=false} % disable two-side formatting for scrbook
% alternatively, for shorter essay, use the following
% \documentclass{scrartcl}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Useful packages
@stormvirux
stormvirux / matplotlibrc
Created September 10, 2019 11:16
The default matplotlib config (matplotlibrc)
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in the following location:
# unix/linux:
# $HOME/.config/matplotlib/matplotlibrc or
@stormvirux
stormvirux / custom.mplstyle
Created September 10, 2019 11:08
Some major parameters that needs to be changed to produce publication quality figures in matplotlib
# Set the backend, otherwise the figure won't show up. Note that this will
# depend on your system setup; to see which backend is the default,
# run "matplotlib.get_backend()" in the Python interpreter.
backend : GTK3Agg
# Increase the default DPI, and change the file type from png to pdf
savefig.dpi : 300
savefig.format : pdf
# Instead of individually increasing font sizes, point sizes, and line
@stormvirux
stormvirux / metropolis.mplstyle
Created September 10, 2019 10:26
Matplotlib graphics for the metropolis beamer theme
# Matplotlib style file to create plots that integrate nicely
# with the metropolis beamer template
# Colours pulled from beamermetropolis.sty
# Background colour in beamermetropolis.sty is as black!2
# not very useful for matplotlib. Approximate as FAFAFA
# Based on mplstyle file by Jack Walton (https://github.com/jwalton3141/CV/blob/master/cv.pdf)
axes.axisbelow: True
axes.edgecolor: White