Skip to content

Instantly share code, notes, and snippets.

bryanknox / .editorconfig
Last active Jul 9, 2022
.editorconfig for C# Visual Studio projects
View .editorconfig
# EditorConfig is awesome:
# More info about editorconfig for C# and .NET in Visual Studio see:
# Most of the .NET and C# rules below were taken from the
# Microsoft Roslyn team's editorconfig at:
# Top-most EditorConfig file.
View MSSQL executed query history
USE master
SELECT sdes.database_id
oguzalb /
Created Apr 17, 2020
A simple stack machine implementation for Python in Python
import dis
# Run this with python3 : )
class VM:
def __init__(self):
self.stack = []
def push(self, value):
def pop(self):
return self.stack.pop()
premek /
Last active May 8, 2022
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
gokulkrishh /
Last active Jun 28, 2022
List of useful npx (Node Package Runner) commands (

NPX (NPM Package Runner) Commands

List of useful npx (NPM Package Runner) commands.

What is NPX?

Using NPX we can execute/run node binaries without the need to install it locally or globally.


ninhanh /
Created Jun 28, 2019 — forked from gbedoya/
The Web Application Hacker's Handbook - Task Checklist - Github-Flavored Markdown
wybiral / noscript-tracking.go
Last active Feb 14, 2022
Tracking cursor position in real-time with remote monitoring (without JavaScript)
View noscript-tracking.go
// Tracking cursor position in real-time without JavaScript
// Demo:
package main
import (
View Reflaction
1. A General Fast Method Invoker (
public static FastInvokeHandler GetMethodInvoker(MethodInfo methodInfo)
DynamicMethod dynamicMethod = new DynamicMethod(string.Empty,
typeof(object), new Type[] { typeof(object),
typeof(object[]) },
ILGenerator il = dynamicMethod.GetILGenerator();
ParameterInfo[] ps = methodInfo.GetParameters();
Type[] paramTypes = new Type[ps.Length];
CleanCoder / Task Extension
Last active Apr 8, 2020
Task Extension
View Task Extension
static async Task<T> Otherwise<T> (this Task<T> task, Func<Task<T>> orTask) {
task.ContinueWith (async innerTask => {
if (innerTask.Status == TaskStatus.Faulted)
return await orTask ();
return await Task.FromResult<T> (innerTask.Result);
}).Unwrap ();
static async Task<T> Retry<T> (Func<Task<T>> task, int retries, TimeSpan delay, CancellationToken cts = default (CancellationToken)) {
View WinDBG
1) 准备工作
.loadby sos clr
.cordll -ve -u -l
.load <<path>>\sosex.dll
.load <<path>>\mex.dll
2) 常用方法
!pe [<exceptionAddr>] most recent exception data (don’t forget the external stack)