Skip to content

Instantly share code, notes, and snippets.

View shanginn's full-sized avatar
🔨
building stuff

Николай Шангин shanginn

🔨
building stuff
View GitHub Profile
@lenary
lenary / exit-status.plugin.zsh
Last active October 31, 2023 03:19
Last command's exit status, for your prompt. Put ${last_exit} into your prompt somewhere. It uses zsh's prompt escapes.
precmd_functions=("_exit_status" ${precmd_functions[@]})
function _exit_status() {
local last_exit_status=$?
export last_exit=""
if [ -z "${last_exit_status}" ]; then
last_exit=""
elif (( last_exit_status != 0 )); then
local description
<!--
ASP Webshell
Working on latest IIS
Referance :-
https://github.com/tennc/webshell/blob/master/fuzzdb-webshell/asp/cmd.asp
http://stackoverflow.com/questions/11501044/i-need-execute-a-command-line-in-a-visual-basic-script
http://www.w3schools.com/asp/
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active February 27, 2024 14:08
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@thejoshwolfe
thejoshwolfe / random128.js
Last active September 5, 2019 05:57
Generates a 128-bit random number as a string.
/** random 128-bit number as a string */
function random128() {
var result = "";
for (var i = 0; i < 8; i++)
result += String.fromCharCode(Math.random() * 0x10000);
return result;
}
/** random 128-bit number in canonical uuid format. all bits are random. */
function random128Hex() {