Skip to content

Instantly share code, notes, and snippets.

View mdrakiburrahman's full-sized avatar
💤
living the data dream

Raki mdrakiburrahman

💤
living the data dream
View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@k-maru
k-maru / format.cs
Last active April 16, 2024 00:47
T-SQL Format C# Code
class Program {
static void Main(string[] args) {
var query = "select A.ID, A.NAME from (select ID, NAME from BAR) A where A.ID = '1'";
var parser = new TSql120Parser(false);
IList<ParseError> errors;
var parsedQuery = parser.Parse(new StringReader(query), out errors);
if (errors.Count > 0) {
foreach (var err in errors) {
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(err.Message);
@veggiemonk
veggiemonk / CKAD.md
Last active March 8, 2024 10:22
CKAD exam preparation
@nerdsrescueme
nerdsrescueme / regex.txt
Created September 23, 2011 16:08
Common Regex
Perl and PHP Regular Expressions
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters.
All Major Credit Cards
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa.
//All major credit cards regex
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/'
@fonic
fonic / python_dual_log_setup.py
Last active October 30, 2023 11:53
Python dual-logging setup (console and log file) supporting different log levels and colorized output
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# -
# Python dual-logging setup (console and log file), -
# supporting different log levels and colorized output -
# -
# Created by Fonic <https://github.com/fonic> -
# Date: 04/05/20 - 02/07/23 -
@IAmStoxe
IAmStoxe / Delete-PodsByRegex.ps1
Created June 26, 2020 16:36
Delete all kubernetes pods by regex pattern with PowerShell
$NS="NameSpace"; $Pattern="amass"; & kubectl get pods -n $NS | % {"$_" -Split " "} | Select-String -Pattern $Pattern | %{ & kubectl delete -n $NS pod $_ }
@peixian
peixian / az_metrics.csv
Last active March 7, 2021 12:14
az metrics
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 7 columns, instead of 6. in line 5.
,Metric,Metric Display Name,Unit,Aggregation Type,Description,Dimensions
1, azure.analysisservices_servers.qpu_metric,QPU,Count,Average," Microsoft.AnalysisServices/servers: QPU. Range 0-100 for S1, 0-200 for S2 and 0-400 for S4",ServerResourceType
2, azure.analysisservices_servers.memory_metric,Memory,Bytes,Average," Microsoft.AnalysisServices/servers: Memory. Range 0-25 GB for S1, 0-50 GB for S2 and 0-100 GB for S4",ServerResourceType
3, azure.analysisservices_servers.total_connection_requests,Total Connection Requests,Count,Average, Microsoft.AnalysisServices/servers: Total connection requests. These are arrivals.,ServerResourceType
4, azure.analysisservices_servers.successfull_connections_per_sec,Successful Connections Per Sec,CountPerSecond,Average, Microsoft.AnalysisServices/servers: Rate of successful connection completions.,ServerResourceType
5, azure.analysisservices_servers.total_connection_failures,Total Connection Failures,Count,Average, Microsoft.AnalysisServices/servers: Total failed connection