Skip to content

Instantly share code, notes, and snippets.

View harrygallagher4's full-sized avatar

Harry Gallagher harrygallagher4

View GitHub Profile
@harrygallagher4
harrygallagher4 / git-update.sh
Last active October 13, 2019 19:07
bash one-liner to pull all git repositories in the current directory
# most of this is sourced from stackoverflow answers
# git diff checks if the current directory is clean
# git remote checks if there is even a remote repo to pull from
ls | xargs -I{} sh -c '[[ -d {}/.git ]] && [[ $(git -C {} diff --shortstat 2> /dev/null | tail -n1) == "" ]] && [[ $(git -C {} remote) != "" ]] && echo {}: && git -C {} pull'

Keybase proof

I hereby claim:

  • I am harrygallagher4 on github.
  • I am harryg (https://keybase.io/harryg) on keybase.
  • I have a public key ASC0pmQNZH9F4R01u2XJgTh1_Qi7Cfid4hpDzTAvQO-yBQo

To claim this, I am signing this object:

@harrygallagher4
harrygallagher4 / 0-install.md
Last active May 28, 2020 07:00
hackernews dark mode

Install directly with Stylus

{
"npm.binPath": "/Users/harry/.asdf/installs/nodejs/12.17.0/bin/npm",
"eslint.nodePath": "/Users/harry/.asdf/installs/nodejs/12.17.0/bin/node",
"coc.preferences.bracketEnterImprove": false,
"coc.preferences.enableFloatHighlight": true,
"coc.preferences.colorSupport": true,
"coc.source.around.enable": false,
"coc.source.buffer.enable": false,
"coc.source.file.ignoreHidden": false,
@harrygallagher4
harrygallagher4 / colorutils.lua
Last active April 17, 2021 05:40
lush.nvim + hsluv utils
-- harryg/colorutils.lua
--
-- this was my original implementation of these utils in lua
-- but it doesn't have some of the functions from the fennel version
--
local lush = require'lush'
local hsluv = require'hsluv'
local deg, rad = math.deg, math.rad
@harrygallagher4
harrygallagher4 / init.lua
Last active January 25, 2022 10:52
aniseed fix-module-return compiled lua sample
local _2afile_2a = "/Users/harry/.config/nvim/fnl/dotfiles/init.fnl"
local _2amodule_name_2a = "dotfiles.init"
local _2amodule_2a
do
package.loaded[_2amodule_name_2a] = {}
_2amodule_2a = package.loaded[_2amodule_name_2a]
end
local _2amodule_locals_2a
do
_2amodule_2a["aniseed/locals"] = {}
@harrygallagher4
harrygallagher4 / key.md
Created February 17, 2023 01:03
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

#lang racket
(define (get-renderers render-element render-elements)
`((#:document .
,(λ (doc)
`(article
,@(render-elements (document-body doc))
,@(render-element `(footnotes '() ,@(document-footnotes doc))))))
(#:fallback . ,(λ (tag att els children) `(,tag ,att ,@(children))))
(link .
@harrygallagher4
harrygallagher4 / I_HATE_TYPESCRIPT.md
Created March 29, 2023 04:15
TYPESCRIPT FUNCTION TYPES HAVE DRIVEN ME INSANE AND CAUSED ME TO WRITE A MAKESHIFT BLOG POST ABOUT THEM

TypeScript function types, type predicates, and higher-order functions

I started writing this as a Discord message but ended up needing to write a gist as it got longer so I apologize for the unprofessional language in the beginning

I've run into yet another problem that I've encountered before and it's time to rant about it because this one really bugs me. I think the fundamental problem is that TypeScript function types are extremely shitty. as far as I can tell, you can't express how the return type of a function depends on the type of the