Skip to content

Instantly share code, notes, and snippets.

View PatOConnor43's full-sized avatar
🤔
Working on Updog

Patrick O'Connor PatOConnor43

🤔
Working on Updog
View GitHub Profile
@PatOConnor43
PatOConnor43 / index.html
Created September 30, 2023 18:22
Liminal Prototype
<div class="desktop-4">
<div class="left-panel">
<div class="frame-1466">
<div class="file-tree">
<div class="frame-1467">
<span class="weather"> ▼ Weather </span>
</div>
<div class="frame-1468">
<div class="get-get-weather-for-location">
<span><span class="get-get-weather-for-location-span">GET</span><span class="get-get-weather-for-location-span2">
@PatOConnor43
PatOConnor43 / fuzzy-github-prs.sh
Created May 11, 2022 00:31
A script to open PRs with fzf
### filename: fuzzy-github-prs.sh
### description: A script to open PRs with fzf
# Get the time in seconds 10 days ago
since=$(date -Iseconds -d '10 days ago')
export GH_TOKEN='<YOUR TOKEN WITH NOTIFICATION AND REPO ACCESS>'
export GH_USER='<YOUR USERNAME>'
# Get 10 "notifications" since 10 days ago in json
json=$(curl --silent -u "${GH_USER}":"${GH_TOKEN}" "https://api.github.com/notifications?per_page=10&since=${since}")
@PatOConnor43
PatOConnor43 / tmux-fuzzy-find.sh
Created May 10, 2022 23:58
A snippet to fuzzy find tmux panes
### filename: tmux-fuzzy-find.sh
### description: A snippet to fuzzy find tmux panes
#!/usr/bin/bash
selected_tuple=($(tmux list-panes -s -F '#{window_index} #{pane_index} #{pane_current_path} #{pane_current_command}' | fzf-tmux -h 20))
tmux select-window -t "${selected_tuple[0]}"
tmux select-pane -t "${selected_tuple[1]}"
@PatOConnor43
PatOConnor43 / planthelpers.sh
Created July 21, 2021 04:29
This is a small script that tries to intelligently download plantuml and keep it up-to-date. It also exposes some functions to generate svgs and pngs.
#!/bin/bash
tool_dir=$(dirname $0)
scriptpath="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
plant="$tool_dir/plantuml.jar"
function log {
if [ "$DEBUG" == "true" ]; then
echo "$@"
fi
#!/bin/bash
#================================================================
# HEADER
#================================================================
#% SYNOPSIS
#+ ${SCRIPT_NAME} [-h] channelId
#%
#% DESCRIPTION
#% Download the latest audio from a channel. The channelId can be found in
#% the url for the channel or in the channel's html. It should start with "UC".
@PatOConnor43
PatOConnor43 / lsp_config.lua
Created September 24, 2020 15:24
A small gist to show a dartls setup function to allow all the codeactions. These can be shown with `:lua vim.lsp.buf.code_action()`
local dart_capabilities = vim.lsp.protocol.make_client_capabilities()
dart_capabilities.textDocument.codeAction = {
dynamicRegistration = false;
codeActionLiteralSupport = {
codeActionKind = {
valueSet = {
"",
"quickfix",
"refactor",
"refactor.extract",
@PatOConnor43
PatOConnor43 / after-plugin-_load_lua.vim
Last active August 19, 2022 20:38
This is a minimal example configuration which should allow lua scripts to resolve lua modules that are loaded as a result of packer.nvim. `/` is not allowed as a filename in gist so `-`s are used in their place.
" This was taken from
" https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/after/plugin/_load_lua.vim
let s:load_dir = expand('<sfile>:p:h:h:h')
exec printf('luafile %s/lua/init.lua', s:load_dir)
@PatOConnor43
PatOConnor43 / Retrospective_on_refactoring-chapter1.md
Last active May 10, 2020 05:48
#blog Retrospective on — Refactoring: Improving the Design of Existing Code (Chapter 1)

Retrospective on — Refactoring: Improving the Design of Existing Code (Chapter 1)

Quotes I thought were interesting

"Over time, the code will be modified, and the integrity of the system – its structure according to that design – gradually fades. The code slowly sinks from engineering to hacking." (Preface p.xiv)

If the code works and doesn't ever need to change, it's perfectly fine to leave it alone. It would be nice to improve it, but unless someone needs to understand it, it isn't causing any real harm. (Chapter 1 p.5)

@PatOConnor43
PatOConnor43 / lombok.js
Created February 29, 2020 21:53
This is a small coc-nvim plugin to wrap the Java language server in a Lombok agent to allow completion for Lombok models. Place this file in `.config/nvim/coc-extensions/` with a copy of lombok.jar as well.
const { commands, workspace, ConfigurationTarget, extensions} = require('coc.nvim')
exports.activate = async function(context) {
await setLombokToVSCode(context);
}
async function setLombokToVSCode(context) {
let lombokConfig = {
"path": "lombok.jar",
"vmArgsKey": "java.jdt.ls.vmargs",