Skip to content

Instantly share code, notes, and snippets.

View xPMo's full-sized avatar

Gamma xPMo

View GitHub Profile
:root {
--height: 16px; --icon-size: 16px; --margin: -8px;
--font-size: pt;
--align: left; /* left | center | right */
}
@-moz-document url(chrome://browser/content/browser.xul) {
#nav-bar {
margin: -3px !important;
margin-left: var(--margin) !important;
height: 30px !important;
@xPMo
xPMo / keybase.md
Created October 12, 2017 06:08
keybase.md

Keybase proof

I hereby claim:

  • I am xPMo on github.
  • I am gammafunction (https://keybase.io/gammafunction) on keybase.
  • I have a public key whose fingerprint is 7ABE AF8A 5895 B177 9999 D5A0 61DF 2393 78F6 CA80

To claim this, I am signing this object:

@xPMo
xPMo / newtonsfractal.py
Last active October 1, 2021 21:19
Calculates Newton's Fractal
#!/usr/bin/env python3
# Author: @xPMo
# Based on previous work by: Jordan Atlas
#
# Purpose: creates a fractal using the Newton-Raphson
# root-finding method. The polynomial is derived from the
# given roots in commandline args, or the roots of unity
# are used
#
# Based on listing 7.1 from "Beginning Python Visualization"
# change prefix to Alt+a
unbind-key C-b
set -g prefix 'M-a'
bind-key 'M-a' send-prefix
# escape time of 50 ms
set -sg escape-time 50
set -g default-terminal "screen-256color"
" removed the first page from a pdf with pdftk, but you want to keep the outline?
" change the info file like this:
% s/Number: \(\d\d*\)/\="Number: " . submatch(1)-1/
" You still need to go through and remove (what is now) page 0
@xPMo
xPMo / term-link.c
Last active July 30, 2018 04:59
OSC 8 hyperlink implementation in C using libcurl
@xPMo
xPMo / workflow.md
Last active January 18, 2019 03:14
Planning out a /r/unixporn post

I have a fair amount of custom scripts, but I'm not a "do everything in the terminal" person. Instead, I prefer things like dunst(ify) actions and custom program wrappers. This customized, but not-so-terminal-centric workflow is what I want to highlight in my post.

i3

  • focus/launch mode
  • xfce4-appfinder
  • rofi
  • scratchpad
  • $mod+F1 hint notifications
@xPMo
xPMo / bash-ref-dark.css
Last active January 26, 2019 17:05
Dark theming for local bash reference manual
@-moz-document url-prefix("file:///usr/share/doc/bash/bashref.html") {
body {
background: #002b36;
color: #eee8d5;
font-size: 1.2em;
line-height: 1.4;
max-width: 1200px;
padding: 0.5em;
margin: auto;
}
zip_and_transpose() {
# for convenience, we zip our leading spaces (which provide the offset for diagonal cases) here
# Using ^^ will wrap to previous entries until "argv" is exhausted (this is only useful in the first call)
for s line (${spaces:^^argv})
s+=$line && # concatenate the spaces onto the start of the line
for (( i=0 ; i++ < $#s; ))
a[i]+=$s[i]
}
spaces=(+) # we need to declare this an an array from the start for the zip to work correctly

The following is the ordered list of files Zsh will source for each shell type:

  • L: Login
  • I: Interactive
Shell type: LI L_ _I __
~/.zshenv
${ZDOTDIR:-$HOME}/.zprofile
${ZDOTDIR:-$HOME}/.zshrc