Skip to content

Instantly share code, notes, and snippets.

View borisjoffe's full-sized avatar

Boris Joffe borisjoffe

View GitHub Profile
@WarrenBuffering
WarrenBuffering / useFetchStatus.ts
Last active September 4, 2023 23:47
goated hooks
import { useCallback, useMemo, useState } from 'react';
import { FetchStatus } from '../enums';
export function useFetchStatus() {
const [errorCode, setErrorCode] = useState<number | null>(null);
const [errorMessage, setErrorMessage] = useState<string>('');
const [status, setStatus] = useState<FetchStatus>(FetchStatus.UNFETCHED);
const fail = useCallback((message: string, code?: number) => {
@JoshuaGrams
JoshuaGrams / docs.md
Last active November 17, 2021 05:57
Single stroke navigation and key combos

This is sort of a blend between Ted Morin's excellent cross platform movement dictionary and codepoke's single stroke commands dictionary.

I've been using it intermittently for a couple weeks and I'm happy with it. I'm still slow because I haven't practiced it and don't actually use it much, but I've found it easy to remember what the strokes are, and most of the modifier combos are pretty comfortable for me.

It uses STK to indicate a navigation command on the right, and then P/W/H/R are Super, Control, Alt, and Shift, respectively. You can use these by themselves to press and release the bare modifier (e.g. Super to open the Windows menu, Alt to toggle application menus).

This is mirrored on the right by -LGT, and P/B/F/R are Super/Control/Alt/Shift. Combine this with a fingerspelt letter for key combos. I did not define these alone: they

@antstanley
antstanley / .eleventy.js
Last active September 12, 2022 21:43
Using PurgeCSS and CleanCSS with 11ty to remove unused CSS selectors
const Purgecss = require('purgecss')
const { JSDOM } = require('jsdom')
const CleanCSS = require("clean-css");
//array of css files to combine
const cssFiles = ['./src/css/custom.css','./src/css/markdown.css', './src/css/tachyons.css']
// cleanCSSOptions for minification and inlining css, will fix duplicate media queries
const cleanCSSOptions = {
level: {
@guysoft
guysoft / reminders.py
Created December 31, 2018 10:05
Get google calendar reminder api
#!/usr/bin/env python3
## How to use
##
## 1. enter http://calendar.google.com/
## 2. press ctrl+alt+J in chrome to ender the developer tools and select the "network" tab. In firefox ctrl+shift+elif
## 3. refresh and make sure "reminders" is checked.
## 4. search for "reminder" in url filters and look for a url of the form: https://reminders-pa.clients6.google.com/v1internalOP/reminders/list?key=
## 5. Copy the key and the followind headers and cookies below:
## For mor info see: https://issuetracker.google.com/issues/36760283
@alensiljak
alensiljak / gtk-3.0.css
Last active August 4, 2020 02:25
GnuCash Register customization for a dark theme
/*
These register customizations go well with a dark GTK3 theme
*/
cursor entry {
color: orange;
}
*.register-cursor {
color: blanchedalmond;
@nonducor
nonducor / gcash2ledger.py
Last active September 12, 2023 06:10
A simple script to convert an (uncompressed) gnucash XML file to the ledger-cli format
#! /usr/bin/python3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright
@keithjgrant
keithjgrant / abp-twitter.txt
Last active August 31, 2023 20:48
Adblock plus filters to remove the crap from twitter
twitter.com##.module.trends
twitter.com##.wtf-module
twitter.com##[data-component-context="suggest_activity_tweet"]
twitter.com##.nav>.moments
twitter.com##.LiveVideoHomePageModuleContainer
@HardenedArray
HardenedArray / Efficient Encrypted UEFI-Booting Arch Installation
Last active October 22, 2023 12:14
An effcient method to install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Multi-OS, and VirtualBox, UEFI-booting are also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and
# also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required!
# Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future,
# please ONLY follow my encrypted /boot installation guide, which lives here:
@cryzed
cryzed / fix-infinality.md
Last active April 30, 2024 22:01
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@sieste
sieste / arch-linux-encrypted-kernel-downgrade
Created November 14, 2016 22:35
Minimal instructions for kernel downgrade on arch linux with full system encryption using dm-crypt and luks
# Kernel downgrade on ARCH Linux with encrypted file-system
#
# assumes you followed https://gist.github.com/mattiaslundberg/8620837 to set up your system
#
# Credits:
# https://stephentanner.com/restoring-grub-for-an-encrypted-lvm.html
# https://wiki.archlinux.org/index.php/Kernel_Panics
# Boot into archiso live USB