Skip to content

Instantly share code, notes, and snippets.

@t-mart
t-mart / netrw quick reference.md
Last active May 17, 2024 08:58
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
@inidamleader
inidamleader / AutoSizeText.kt
Last active May 17, 2024 08:58
Composable function that automatically adjusts the text size to fit within given constraints with optimal performance by using a binary search algorithm
// LAST UPDATE: 10 April 2024 v4.3:
// - Correction of updated density value in AutoSizeText function
package com.inidamleader.ovtracker.util.compose
import android.util.Log
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.BoxWithConstraintsScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.foundation.text.InternalFoundationTextApi
#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@seki
seki / drb.rb
Created June 5, 2013 13:32
1st druby. [ruby-list:15406]
drb.rb
#!/usr/local/bin/ruby
=begin
Tiny distributed Ruby --- dRuby
DRb --- dRuby module.
DRbProtocol --- Mixin class.
DRbObject --- dRuby remote object.
DRbConn ---
DRbServer --- dRuby message handler.
=end
@joshschmelzle
joshschmelzle / win-clippy.md
Last active May 17, 2024 08:54
Copy win32 command line output to Windows Clipboard

To save the output of a command on the Windows clipboard, add a pipe* (|) operator to your command followed by the clip command.

Examples

dir | clip - copy the listing of current folder contents to the clipboard.

tree | clip - copy a recursive directory structure to the clipboard.

pwd | clip - copy the present working directory to the clipboard.

## Step 1
Open C:\Windows\System32\drivers\etc\hosts
## Step 2
Add 1.2.3.4 account.jetbrains.com
## Step 3
Add this key to Phpstorm
``1W61R3J3UL-eyJsaWNlbnNlSWQiOiIxVzYxUjNKM1VMIiwibGljZW5zZWVOYW1lIjoi5r+A5rS75p2l5rqQIHd3d8K3YWppaHVvwrdjb20iLCJhc3NpZ25lZU5hbWUiOiIiLCJhc3NpZ25lZUVtYWlsIjoiIiwibGljZW5zZVJlc3RyaWN0aW9uIjoiIiwiY2hlY2tDb25jdXJyZW50VXNlIjpmYWxzZSwicHJvZHVjdHMiOlt7ImNvZGUiOiJEUE4iLCJwYWlkVXBUbyI6IjIwMjEtMDgtMTEifSx7ImNvZGUiOiJEQiIsInBhaWRVcFRvIjoiMjAyMS0wOC0xMSJ9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDIxLTA4LTExIn0seyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMjEtMDgtMTEifSx7ImNvZGUiOiJSU0MiLCJwYWlkVXBUbyI6IjIwMjEtMDgtMTEifSx7ImNvZGUiOiJHTyIsInBhaWRVcFRvIjoiMjAyMS0wOC0xMSJ9LHsiY29kZSI6IkRNIiwicGFpZFVwVG8iOiIyMDIxLTA4LTExIn0seyJjb2RlIjoiUlNGIiwicGFpZFVwVG8iOiIyMDIxLTA4LTExIn0seyJjb2RlIjoiUEMiLCJwYWlkVXBUbyI6IjIwMjEtMDgtMTEifSx7ImNvZGUiOiJSQyIsInBhaWRVcFRvIjoiMjAyMS0wOC0xMSJ9LHsiY29kZSI6IkNMIiwicGFpZFVwVG8iOiIyMDIxLTA4LTExIn0seyJjb2RlIjoiV1MiLCJwYWlkVXBUbyI6IjIwMjEtMDgtMTEifSx7ImNvZGUiOiJSRCIsInBhaWR
@ssddanbrown
ssddanbrown / export-body-start.blade.php
Last active May 17, 2024 08:49
BookStack PDF Export header & footer
@if ($format === 'pdf')
<style media="print">
.print-header-footer {
position: fixed;
width: 100%;
}
.print-footer {
position: fixed;
bottom: -40px;
@K1ethoang
K1ethoang / StarUML-V6.md
Created April 3, 2024 16:31
Active StarUml version 6 for Window
@MatthewJDavis
MatthewJDavis / get-aws-cw-target-id.sh
Created February 4, 2021 14:06
Get ID of AWS cloudwatch event target
# To use the terraform import aws_cloudwatch_event_target provider, we need the rule name and target ID. To find the target ID,
# run the following with the AWS cli.
aws events list-targets-by-rule --rule "ruleName"
# This will return the following and the ID can be used to import the resource.
#{
# "Targets": [
# {
@biggers
biggers / py_syslog_dict_config.py
Last active May 17, 2024 08:49
Python dictConfig logging example using SyslogHandler - modified from Stackoverflow answer
import logging
import sys
from logging import config
# REF, modified from:
# https://stackoverflow.com/a/19367225
if sys.platform == "darwin":
address = '/var/run/syslog'
facility = 'local1'