Skip to content

Instantly share code, notes, and snippets.

View Roxolan0's full-sized avatar

Hugo Jacob Roxolan0

View GitHub Profile
@armincerf
armincerf / git-clubhouse
Last active May 7, 2021 12:04
Run `git config --global clubhouse.token {token}` to set your ch token, then run `git clubhouse {id}` (make sure git-clubhouse is in your $PATH and executable) to checkout a new branch and push it to trigger the clubhouse hook
#! /usr/bin/env bash
function main () {
local id="$1"
local token=$(git config --global --get clubhouse.token)
local story=$(curl -s "https://api.clubhouse.io/api/v3/stories/${id}?token=${token}")
local username=$(git config --global --get github.user)
local name=$(echo "${story}" | jq -r '.name' | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z)
local branch="${username}/ch${id}/${name}"
git checkout ${branch} 2>/dev/null || git checkout -b ${branch}
@kdzwinel
kdzwinel / main.js
Last active April 13, 2024 20:50
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.