Skip to content

Instantly share code, notes, and snippets.

Avatar

Mina Demian minademian

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am minademian on github.
  • I am minademian (https://keybase.io/minademian) on keybase.
  • I have a public key ASD93lruSUIhKNCxwJtvzi0LnIHrJmybAS7eCGKz7VYgwgo

To claim this, I am signing this object:

@minademian
minademian / sanitize-dir-listing
Created Jan 14, 2017
sanitize Linux directory listing
View sanitize-dir-listing
# Sanitize a Linux directory listing so that it shows files, directories, and contents of subdirectories
# useful for sending a listing in an email, IM message, or online
^\-?[a-z]+(\s) # directory bit and file permissions
[0-9]{1}(\s) # directory counter, shows how many subdirectories this file has.
[a-z]+\s # owner
[a-z]+\s+ # group
[0-9]+\s+ # filesize
[a-z]+\s+[0-9]+\s+
[0-9]+:?[0-9]+\s # date, last updated
View cfg-init.sh
git init --bare $HOME/.cfg
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.zshrc
@minademian
minademian / wgetGah.sh
Created May 15, 2017
batch move downloaded PDFs to new dir
View wgetGah.sh
#!/bin/bash
srcDir="/foo/bar" # <--- change this to where you will download the files
newDir="/foo/bar/ouch" # <--- change this to where you want to move the files
url="your url"
echo "Let's download some files..."
wget -m -P $srcDir -A pdf $url
echo "going to $srcDir..."
View scrolling in tmux
# Add this to your .tmux.conf
set -g mouse on
set-option -g -q mouse on
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
View regex scratchpad
^(.*)(\r?\n\1)+$ # search for duplicate lines in file
\: # look for character
\n # put in newline character
@minademian
minademian / ls-output-cleaner
Last active Apr 11, 2018
cleans up output from GCE Storage Bucket if you copy and paste from browser into text editor
View ls-output-cleaner
\/[(\s+)\—]+Folder[(\s+)\—]+
@minademian
minademian / duplicate-lines.regex
Created Apr 11, 2018
delete duplicate lines in text editor
@minademian
minademian / dropdown.md
Last active Apr 27, 2018 — forked from citrusui/dropdown.md
"Dropdowns" in Markdown
View dropdown.md
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
You can’t perform that action at this time.