Skip to content

Instantly share code, notes, and snippets.

View garethclews's full-sized avatar
👻
running on empty

g garethclews

👻
running on empty
View GitHub Profile
@garethclews
garethclews / achievement.css
Created October 13, 2022 17:53
Achievement html
body {
width: 100vw;
height: 100vh;
padding: none;
margin: 0;
overflow: hidden;
margin: auto auto;
display: flex;
flex-flow: column nowrap;
@garethclews
garethclews / example.py
Created October 15, 2020 11:26
implicit line continuation
books = (Book
.objects
.filter(author__in = favourite_authors)
.select_related('author', 'publisher')
.order_by('title'))
@garethclews
garethclews / keybase.md
Created September 19, 2020 13:24
keybase.md

Keybase proof

I hereby claim:

  • I am karetsu on github.
  • I am karasu (https://keybase.io/karasu) on keybase.
  • I have a public key ASBLeP8mCZ48lX2fWlj-BASlYWql-6sd-zUiNoC4jLKWYQo

To claim this, I am signing this object:

weighted_count <- function(data, weights, ...) {
group_ <- enquos(...)
data %>%
group_by(!!!group_) %>%
summarise(amount = sum(.data[[weights]]), n = n())
}
iris %>% weighted_count("Petal.Length", Species)
## A tibble: 3 x 3
# Species amount n
@garethclews
garethclews / ClientMessageEvent
Created February 24, 2020 16:28
How to interpret
Window: 491 ||| type: 319 ||| data: [4,0,0,0,0]
Window: 77594625 ||| type: 318 ||| data: [0,0,0,0,0]
Window: 77594626 ||| type: 318 ||| data: [1,1681204,0,0,0]
[bar/xmonad]
background=#232530
bottom=false
cursor-click=pointer
cursor-scroll=ns-resize
enable-ipc=true
fixed-center=true
font-0=Iosevka Custom:pixelsize=12;3
font-1=Iosevka Nerd Font:pixelsize=12;3
font-2=Iosevka Custom:pixelsize=12:style=bold;3
@garethclews
garethclews / power.sh
Created February 7, 2020 11:21
aloysius' dzen2 power menu
#!/usr/bin/env zsh
set -e
#-- CONFIGURATION ---------------------------------------------------------------
# Change the icon colours here
BASE="#1c1e26" ## background
YELLOW="#f09383" ## bolts
GREEN="#09f7a0" ## suspend
WHITE="#2e303e" ## reboot
signal time=1574972670.810419 sender=org.freedesktop.DBus -> destination=:1.52 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
string ":1.52"
signal time=1574972670.810431 sender=org.freedesktop.DBus -> destination=:1.52 serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameLost
string ":1.52"
method call time=1574972676.670415 sender=:1.11 -> destination=:1.14 serial=138 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.impl.portal.Background; member=GetAppState
error time=1574972676.670641 sender=:1.14 -> destination=:1.11 error_name=org.freedesktop.portal.Error.Failed reply_serial=138
string "Could not get window list: Cannot invoke method; proxy is for the well-known name org.gnome.Shell without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag"
method call time=1574972691.745825 sender=:1.53 -> destination=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.fr
@garethclews
garethclews / ashlee.R
Last active June 12, 2019 17:26
R data manipulation request
# Passing over a set of columns and passing out 0 || 1 depending on any value
# matching specified flag
library("tidyverse") # %>%, pmap, mutate, select
library("DescTools") # %like%
# I would very much like to use importFrom but don't have a NAMESPACE here
# putting this here just to clarify the mutate call below
is.parent <- function(xs) any(xs == "08")