Skip to content

Instantly share code, notes, and snippets.

@lwilli
lwilli / git-ls.sh
Created January 30, 2023 20:31
Like ls, but lists files' last git modification date
#! /bin/sh
# Like ls, but lists files' last git modification date
# Adapated from https://stackoverflow.com/a/73512835/3345085
# To easily create a git alias for this, import it into your git config by running:
# echo "git config --global alias.ls $(printf '%q' "`echo -n \!; cat ~/scripts/git-ls.sh`")" | bash -
for i in *;
do
@lwilli
lwilli / altair-settings.json
Last active June 8, 2022 21:05
GraphiQL-style Theme for Altair GraphQL Client
{
"theme": "system",
"language": "en-US",
"enableExperimental": false,
"addQueryDepthLimit": 5,
"tabSize": 2,
"theme.dark": "system",
"theme.editorFontSize": 13,
"theme.editorFontFamily": "Consolas,Inconsolata,Droid Sans Mono,Monaco,monospace",
"themeConfig": {
#!/usr/bin/env osascript
# Send macOS notifications to yourself.
# Useful for notifying yourself when a long-running process is complete.
#
# Usage: ding [title]
#
# For example:
# gw test; ding Finished tests
@lwilli
lwilli / scala-type-cheatsheet.md
Last active June 12, 2021 00:09
Scala Type Cheatsheet

Scala Type Cheatsheet

Type Bounds

T <: A declares that type variable T refers to a subtype of type A (or type A itself).

T >: A expresses that the type parameter T or the abstract type T refers to a supertype of type A (or type A itself).

@lwilli
lwilli / prettify_xml.rs
Created March 11, 2021 17:12
Prettify XML in Rust using the quick_xml library
use quick_xml::events::Event;
use quick_xml::{Reader, Writer};
/// Prettify XML by adding proper new lines and indentation.
///
/// This uses the quick_xml library (https://github.com/tafia/quick-xml) to read/parse the given
/// XML string and then write it to a string as indented XML. This isn't perfect and most likely
/// not the most efficient.
///
/// One strange behavior is that a closing element tag is not put on a new line if it follows a
@lwilli
lwilli / simple-20-20-20-timer.sh
Last active October 25, 2020 22:34
A simple Mac script for 20-20-20 rule reminders
#!/bin/bash
while :
do
sleep 1200
osascript -e 'display notification "" with title "Take a 20 second break."'
sleep 20
osascript -e 'display notification "" with title "Break time is over!"'
done

Keybase proof

I hereby claim:

  • I am lwilli on github.
  • I am lwilli (https://keybase.io/lwilli) on keybase.
  • I have a public key ASBpdKpsIcL3bf_Y3f154tNEhRv70XHPiYOeCIkT3t9Gxgo

To claim this, I am signing this object:

@lwilli
lwilli / CopyMacNotesToEvernote.spct
Created February 4, 2018 18:17
Copies all folders and their notes from the Mac Notes app to Evernote
(*
Copies all folders and their notes from the Mac Notes app to Evernote.
How to run:
1. Download and setup Evernote on your Mac if you haven't already.
2. Open the Script Editor app on your Mac.
3. Copy and paste this script into the Script Editor.
4. Run the script (press the play button or via the menu Script>Run or ⌘R).
Considerations: