Skip to content

Instantly share code, notes, and snippets.

View aclarknexient's full-sized avatar

Anthony Jarvis-Clark aclarknexient

  • Launch by NTT Data
  • Ann Arbor, Michigan
View GitHub Profile
@aclarknexient
aclarknexient / dummy.md
Created March 13, 2024 16:40
Sharing HN pic

image

@aclarknexient
aclarknexient / userChrome.css
Created February 19, 2024 14:01
Firefox css to disable horizontal tabs
#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items {
opacity: 0;
pointer-events: none;
}
#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
visibility: collapse !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
display: none;
@aclarknexient
aclarknexient / checkout.py
Created November 23, 2023 18:34
python git checkout using pygit2
import pygit2
def checkout_branch(path, branch_name):
repo = pygit2.Repository(path)
# If the branch isn't already in the local list,
# you have to create a ref for it to point at
# in order to avoid detached head state
if branch_name not in repo.branches.local:
@aclarknexient
aclarknexient / ublock.txt
Created October 13, 2023 13:43
ublock origin hackernews dark mode and narrower comment display
! The following 2 lines are what I use to display news.ycombinator.com
! Limit comments to 70 characters wide, making them easier to read
news.ycombinator.com##.comment:style(max-width: 70ch !important; overflow: hidden !important;)
! Invert the colours of the site, making a dark mode that I like
! `invert(95%)` does most of the work,
! but you can tweak the hue-rotate value to fine tune the colours
news.ycombinator.com##html:style(filter:invert(95%) hue-rotate(200deg); background: white)
@aclarknexient
aclarknexient / shortcuts.md
Last active August 5, 2023 22:56
Readline shortcuts

Readline Keyboard Shortcuts

Copied from the readline documentation.

For MacOS, replace Ctrl with Cmd, and Meta with Option.

Shortcut Comment
Ctrl+A Beginning of line
Ctrl+B / Backward one character
@aclarknexient
aclarknexient / .iterm-colours.zsh
Last active March 19, 2024 03:51
Set iTerm2 tab colours based on the command you are running
# A dotfile to turn iTerm2 tabs a different colour based on the command glob.
# Useful for marking different environments in different colours.
# Cargo-culted from multiple sources, apologies for not fully acknowledging them :(
# Edit the line that reads "if [[ "$1" =~ "^(login-helper) " ]]; then" and replace
# "login-helper" with whatever command you use to authenticate. Then modify the case
# statement to match your auth command's arguments. For example: you may use a script
# called "authsaml" to authenticate, and its arguments are dev, test, preprd, and prd.
# Change the colour function you call if you want to change tab colours.
@aclarknexient
aclarknexient / sane-caching.nginx.conf
Created March 31, 2022 12:53 — forked from philipstanislaus/sane-caching.nginx.conf
Sample Nginx config with sane caching settings for modern web development
# Sample Nginx config with sane caching settings for modern web development
#
# Motivation:
# Modern web development often happens with developer tools open, e. g. the Chrome Dev Tools.
# These tools automatically deactivate all sorts of caching for you, so you always have a fresh
# and juicy version of your assets available.
# At some point, however, you want to show your work to testers, your boss or your client.
# After you implemented and deployed their feedback, they reload the testing page – and report
# the exact same issues as before! What happened? Of course, they did not have developer tools
# open, and of course, they did not empty their caches before navigating to your site.
403 ERROR
The request could not be satisfied.
Request blocked. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customer through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Request ID: ...