Skip to content

Instantly share code, notes, and snippets.

@jasonm23
jasonm23 / xterm-256color.svg
Last active July 10, 2024 20:18
Xterm 256color mode color chart, organised into sections. (used on Wikipedia/xterm)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@awidegreen
awidegreen / vim_cheatsheet.md
Last active June 17, 2024 03:41
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@woods
woods / gen-key-script
Last active June 26, 2024 00:37
Creating gpg keys non-interactively
Key-Type: 1
Key-Length: 2048
Subkey-Type: 1
Subkey-Length: 2048
Name-Real: Root Superuser
Name-Email: root@handbook.westarete.com
Expire-Date: 0
@arinto
arinto / TargetTyping.java
Last active April 7, 2017 05:49
A target-typing example in Java 8
public class TargetTyping {
public static void main(String[] args) throws IOException {
String value = System.getProperty("user.dir");
File f = new File(value);
//without target typing
System.out.println("Without target typing example, to find file that ends with xml");
for(File resFile: f.listFiles((File sf) -> sf.getName().endsWith(".xml"))) {
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 26, 2024 08:54
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@HopefulLlama
HopefulLlama / properties.groovy
Last active June 4, 2024 08:17
Print all properties of a Groovy object
println object.properties
.sort{it.key}
.collect{it}
.findAll{!['class', 'active'].contains(it.key)}
.join('\n')
@keithpitty
keithpitty / tmux-ngrok.md
Last active December 15, 2023 16:24
Pairing with tmux and ngrok

Steps for Remote Pairing using tmux and ngrok

The following steps facilitate remote pairing using:

  • tmux which allows terminal sessions to be attached to different terminals, and
  • ngrok which provides secure tunnels to your localhost

1. Install tmux

OS X: brew install tmux

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@romainl
romainl / redir.md
Last active July 9, 2024 16:26
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

@bregenspan
bregenspan / diveTo.js
Last active December 17, 2020 02:17
Recursively dive() to deeply-wrapped components via Enzyme
import merge from 'lodash/merge';
/**
* Given an Enzyme ShallowWrapper and component identifier, dives() down until the
* specified component is the root component.
*
* @param { Enzyme.ShallowWrapper } shallowWrapper - wrapper to dive into
* @param { string } name of component to dive for (should match constructor name).
* @param { object= } options to pass to dive()
*/