Skip to content

Instantly share code, notes, and snippets.

View HarrisonMc555's full-sized avatar

Harrison McCullough HarrisonMc555

View GitHub Profile
@lancethomps
lancethomps / close_notifications_applescript.js
Last active June 18, 2024 19:51
AppleScript to close all notifications on macOS Big Sur, Monterey, and Ventura
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
const CLEAR_ALL_ACTION = "Clear All";
const CLEAR_ALL_ACTION_TOP = "Clear";
@samvrlewis
samvrlewis / longest-git-commit-message
Last active January 18, 2024 12:48
Get the longest git commit messages
git rev-list --no-merges "${1:-HEAD}" | while read rev; do echo "$(git show -s --format='%b' $rev | wc -w) words: $rev"; done | sort -rn | head -6 | cut -f2 -d: | xargs -I{} git rev-list --pretty=medium {} --max-count=1
@muhqu
muhqu / amzn-music
Created April 16, 2018 11:36
Control playback of Amazon Music via command line.
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2018 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@Ketrel
Ketrel / relBase.html
Last active June 2, 2024 21:25
Relative url base for jekyll
{% assign relBase = '' %}
{% assign tempDepth = page.url | append: 'hackish-solution' | split: '/' | size | minus: 2 %}
{% for i in (1..tempDepth) %}
{% assign relBase = relBase | append: "../" %}
{% endfor %}
{% if relBase == '' %}
{% assign relBase = './' %}
{% endif %}
@PerpetualBeta
PerpetualBeta / karabiner.json
Created June 30, 2017 06:17
Karabiner Configuration File
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@fredcy
fredcy / cartesian.elm
Last active November 2, 2019 18:03
Cartesian product of two lists in Elm
import Html exposing (text)
main =
text <| toString <| cartesian ["a", "b", "c"] [1..5]
cartesian : List a -> List b -> List (a,b)
cartesian xs ys =
List.concatMap
( \x -> List.map ( \y -> (x, y) ) ys )
xs
@akr4
akr4 / any2pdf
Last active March 10, 2022 06:18
convert any format supported by Pygments to pdf
#!/bin/sh
# Usage:
# ./any2pdf index.html
# ./any2pdf main.go
#
# Requirements:
# - Pygments
# - ImageMagick
# - wkhtmltopdf
@ustun
ustun / eslint-auto.el
Created January 12, 2016 23:59
run eslint --fix on emacs file save
;;; runs eslint --fix on the current file after save
;;; alpha quality -- use at your own risk
(defun eslint-fix-file ()
(interactive)
(message "eslint --fixing the file" (buffer-file-name))
(shell-command (concat "eslint --fix " (buffer-file-name))))
(defun eslint-fix-file-and-revert ()
(interactive)
@hyOzd
hyOzd / delete-file-and-buffer.el
Created July 21, 2015 11:55
emacs delete current file and close the buffer
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/
(defun delete-file-and-buffer ()
"Kill the current buffer and deletes the file it is visiting."
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?"))
(progn
(delete-file filename)
(message "Deleted file %s." filename)
@lorenzosaino
lorenzosaino / ssh-proxy-no-netcat.sh
Last active June 22, 2018 20:14
SSH config to connect to an SSH server through an SSH proxy without netcat
# These are SSH configuration examples to connect to an SSH server via
# an SSH proxy. These solutions, differently from other solutions found
# on the Web, do not require netcat.
#
# CLIENT -------- PROXY_HOST ------- TARGET_HOST
#
# This config entry allows you to connect to a specific machine behind an
# SSH proxy
Host <TARGET_HOST>