Skip to content

Instantly share code, notes, and snippets.

View cometsong's full-sized avatar
🥸

Benjamin Leopold cometsong

🥸
  • Sol III
View GitHub Profile
@darcyparker
darcyparker / vimModeStateDiagram.svg
Last active July 4, 2024 12:03
Vim Modes Transition Diagram in SVG https://rawgithub.com/darcyparker/1886716/raw/eab57dfe784f016085251771d65a75a471ca22d4/vimModeStateDiagram.svg Note, most of the nodes in this graph have clickable hyperlinks to documentation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active July 4, 2024 17:31
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@brwnj
brwnj / bcl2fastq.py
Created December 24, 2014 18:56
bcl2fastq wrapper
#!/usr/bin/env python
# coding=utf-8
"""
Runs bcl2fastq creating fastqs and concatenates fastqs across lanes. Intended
to be used with NextSeq data and it does not do any cleanup! Original dumped
fastqs will remain along with all of the bcl files.
"""
from __future__ import print_function
@junegunn
junegunn / vimawesome.vim
Last active May 10, 2023 15:50
Plugin completion using VimAwesome API
" ----------------------------------------------------------------------------
" vimawesome.com
" ----------------------------------------------------------------------------
function! VimAwesomeComplete() abort
let prefix = matchstr(strpart(getline('.'), 0, col('.') - 1), '[.a-zA-Z0-9_/-]*$')
echohl WarningMsg
echo 'Downloading plugin list from VimAwesome'
echohl None
ruby << EOF
require 'json'
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@adscriven
adscriven / termedit.vim
Last active May 30, 2018 11:17
Edit files under the cursor in :terminal
" termedit.vim -- Edit a file under the cursor in a terminal window.
" https://gist.github.com/adscriven/1fde7e3aa362b8f9700677352e97f56e
" Public domain.
" [ ] add mappings for opening a terminal window and doing 'ls'
" REQUIREMENTS
" Vim 8.0.0693 or later with the +terminal feature.
" Supports bash with both vi and emacs keybindings, and cmd.exe.
@aaronNGi
aaronNGi / newscript.sh
Created April 28, 2020 20:38
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts
@wflynny
wflynny / susage
Last active July 29, 2020 02:00
Small utility to run top or nvidia-smi on a compute node from the login node
#!/usr/bin/env bash
TEMP=$(getopt -o hsg --long help,snapshot,gpu -n 'susuage' -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
SNAPSHOT=false
@rgreenblatt
rgreenblatt / example_map.vim
Created April 20, 2021 16:28
Composable window maps for vim
let g:window_key_prefix = "<space>"
" the first value is the key and the second is the new window command
let g:window_key_mappings = [
\ ["h", "aboveleft vsplit"],
\ ["j", "belowright split"],
\ ["k", "aboveleft split"],
\ ["l", "belowright vsplit"],
\ [",",
\ "let buf = bufnr('%') <bar> tabnew <bar> execute 'buffer' buf"],
\ [".", ""],