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 ali@parsai.net
## 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
#!/usr/bin/env python2.7
import time
_URL = 'http://localhost/tmp/derp.html'
_NUMBER = 1000
def test_urllib2():
import urllib2