Skip to content

Instantly share code, notes, and snippets.

View LinuxIsCool's full-sized avatar
💭
Preparing the ship.

Shawn Anderson LinuxIsCool

💭
Preparing the ship.
View GitHub Profile
@LinuxIsCool
LinuxIsCool / Keybase.md
Created April 24, 2020 00:30
keybase.md

Keybase proof

I hereby claim:

  • I am linuxiscool on github.
  • I am ygg_anderson (https://keybase.io/ygg_anderson) on keybase.
  • I have a public key ASCCxE8Nno4M7mFefooNqAXTTddQBPNppDdQCeEdbWk6nwo

To claim this, I am signing this object:

@LinuxIsCool
LinuxIsCool / capsremap
Created June 5, 2020 03:03
This is the file I use to remap caps to escape and ctrl on Debian based OS (Ubuntu)
# make CapsLock behave like Ctrl:
setxkbmap -option ctrl:nocaps
# make short-pressed Ctrl behave like Escape:
# Default timeout is 500ms
xcape -t 300 -e 'Control_L=Escape'
@LinuxIsCool
LinuxIsCool / gnome-alt-tab-current-workspace.txt
Last active August 16, 2020 07:46
Gnome 3: Alt-tab on current workspace only
gsettings set org.gnome.shell.app-switcher current-workspace-only true
@LinuxIsCool
LinuxIsCool / gensin.py
Created August 18, 2020 18:54
Canadian mock SIN number generator
# Shawn Anderson October 12 2019
# Inspired by https://github.com/corbanworks/fng-sin-tools/blob/master/fngsin.class.php
import random
from math import floor
def generateSIN():
validPrefix = [1,2,3,4,5,6,7,9]
sin = [random.choice(validPrefix)]
length = 9
@LinuxIsCool
LinuxIsCool / django_channels_recipe.fish
Last active September 9, 2020 18:58
This fish scripts bootstraps the tutorial that can be found here: https://channels.readthedocs.io/en/latest/tutorial/part_1.html Virtualfish is used for the environment.
# Name the environment, project and app
set -q ENVIRONMENT_NAME; or set ENVIRONMENT_NAME channels_tutorial
set -q PROJECT_NAME; or set PROJECT_NAME mysite
set -q APP_NAME; or set APP_NAME chat
# Initialize the environment
vf new $ENVIRONMENT_NAME
vf connect
pip install django channels django-redis channels-redis
@LinuxIsCool
LinuxIsCool / nvim pictures
Last active September 15, 2020 19:50 — forked from fimkap/gist:565d97a6a57a7b9283c8663ae8c9eab1
NeoVim, FZF and termpix setup
# install termpix from https://github.com/mmacedoeu/termpix
# in init.vim, change path to termpix
let g:fzf_layout = { 'down': '~60%' }
let g:fzf_files_options =
\ '--preview "(~/dev/termpix/bin/termpix --width 50 --true-color {} || cat {}) 2> /dev/null "'
@LinuxIsCool
LinuxIsCool / dash-to-panel.settings
Last active September 23, 2020 15:51
Gnome Dash to Panel Settings
[/]
animate-app-switch=true
appicon-margin=4
appicon-padding=8
available-monitors=[0, 1, 2]
click-action='CYCLE-MIN'
dot-color-1='#8ae234'
dot-color-2='#73d216'
dot-color-3='#4e9a06'
dot-color-4='#4e9a06'
@LinuxIsCool
LinuxIsCool / path_explorer.fish
Created September 25, 2020 06:39
Fish recipe for interactively searching all of the commands on your path and openining the selected man page.
# Inspiration from: https://github.com/jorgebucaran/cookbook.fish#how-do-i-find-and-run-commands-in-fish
# Set $all_commands to a list of all commands available on $PATH
set -l all_commands (ls $PATH | column)
# Use `whatis` to append a one-line description of each command to a file
for p in $all_commands
whatis $p | tee -a all_command_descriptions
end
@LinuxIsCool
LinuxIsCool / og_fish_prompt.fish
Created September 25, 2020 08:50
Backing up my favourite fish prompt. A modification of the gentoo omf theme.
function _virtualfish
if set -q VIRTUAL_ENV
echo -n -s (set_color white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " "
end
end
function fish_prompt
set fish_greeting
set -l cyan (set_color -o cyan)
set -l red (set_color -o red)
@LinuxIsCool
LinuxIsCool / pacmd-loopback.fish
Last active October 5, 2020 04:43
Interactively loop audio with fzf and fish shell. I use this function to play audio on my headphones and bluetooth speakers at the same time. I do this by selecting my system output to be the speakers, and then looping the speaker output into my headphones.
function pacmd-loopback --description 'Loop a pacmd source into a pacmd sink interactively.'
if test (set source (pacmd list-sources | grep name: | awk '{ print $2 }' | cut -d'<' -f2 | cut -d'>' -f1 | fzf-tmux --header="Select a source" --phony); set sink (pacmd list-sinks | grep name: | awk '{ print $2 }' | cut -d'<' -f2 | cut -d'>' -f1 | fzf-tmux --header="Select a sink:"); printf "No\nYes" | fzf-tmux --header="CONFIRM: <$source> -> <$sink>") = "Yes"
pacmd load-module module-loopback source=$source sink=$sink
else
echo "Aborted."