Skip to content

Instantly share code, notes, and snippets.

View LukeSavefrogs's full-sized avatar
💭
Thinking about what to script next

Luca Salvarani LukeSavefrogs

💭
Thinking about what to script next
View GitHub Profile
@anthonyaxenov
anthonyaxenov / stacktrace.sh
Last active June 28, 2023 14:10 — forked from akostadinov/stack_trace.sh
[SHELL] Print stacktrace
# Original: https://gist.github.com/akostadinov/33bb2606afe1b334169dfbf202991d36
# The difference is that this func outputs stacktrace in reverse order (from top level to lower ones)
function print_stacktrace () {
STACK=""
local i
local stack_size=${#FUNCNAME[@]}
echo "Stacktrace:"
# skip this function and "MAIN non_file_source:0"
for (( i=$stack_size-1; i>=1; i-- )); do
local func="${FUNCNAME[$i]}"
@sdondley
sdondley / tmux split-window subcommand.md
Last active April 23, 2024 11:49
Super Guide to the split-window tmux Subcommand (and Beyond)

Super Guide to the split-window tmux Subcommand (and Beyond)

Guide overview

tmux, like other great software, is deceptive. On the one hand, it's fairly easy to get set up and start using right away. On the other hand, it's difficult to take advantage of tmux's adanced power features without spending some quality alone time with the manual. But the problem with manuals is that they aren't geared toward beginners. They are geared toward helping seasoned developers and computer enthusiasts quickly obtain the

@pretty
pretty / RetryTest.php
Last active May 16, 2019 13:14 — forked from orottier/RetryTest.php
Retry function for PHP with exponential backoff
<?php
class RetryTest extends TestCase
{
public function setUp()
{
parent::setUp();
// abuse superglobal to keep track of state
$_GET['a'] = 0;
}
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active April 25, 2024 23:03
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@hdodov
hdodov / iframechange.js
Last active September 15, 2023 15:35
HTML iframe URL change listener for tracking when a new iframe page starts to load
function iframeURLChange(iframe, callback) {
var lastDispatched = null;
var dispatchChange = function () {
var newHref = iframe.contentWindow.location.href;
if (newHref !== lastDispatched) {
callback(newHref);
lastDispatched = newHref;
}
@thikade
thikade / wasdecode.md
Last active November 9, 2023 15:48
WebSphere wsadmin-embedded password en/decoder

Decode WAS password using wsadmin.sh:

./wsadmin.sh -lang jython -conntype none -c 'import com.ibm.ws.security.util.PasswordDecoder as pd; pd.main(["{xor}KzosK25tbH4n"]);'

Encode WAS password using wsadmin.sh:

./wsadmin.sh -lang jython -conntype none -c 'import com.ibm.ws.security.util.PasswordEncoder as pd; pd.main(["test123!x"]);'
@rtomayko
rtomayko / ssh-persistent-control-master.md
Created June 7, 2017 19:43
10x SSH connection speedup w/ persistent control masters

SSH Persistent Control Master Config

Add to ~/.ssh/config:

Host *
  # Enable persistent connection multiplexing
  ControlMaster auto
  ControlPath ~/.ssh/-%r@%h:%p
 ControlPersist 600
@refo
refo / bash-filepath-parts.md
Last active February 2, 2024 11:57
Extract file name / file path parts using bash

Extract given file path into its parts

Assuming, file passed as a parameter

path=$1

following script will extract file path into parts

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment