This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require metapict) | |
(require metapict/pict) | |
(struct M-edge (turn) #:transparent) | |
(struct X+ M-edge () #:transparent) | |
(struct X- M-edge () #:transparent) | |
(struct A+ M-edge () #:transparent) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Purpose: Bulk-delete GitLab pipelines older than a given date | |
# Author: github.com/chrishoerl | |
# GitLab API: v4 | |
# Requirements: jq must be instaled ($ sudo apt install jq) | |
# API example: https://gitlab.example.com/api/v4/projects | |
# API example: https://gitlab.example.com/api/v4/projects/<projectid>/pipelines | |
# | |
# NOTE: Script is just a dryrun. To really delete pipelines, simply uncomment line 49 to activate | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeu | |
trap 'STATUS=${?}; echo "${0}: Error on line ${LINENO}: ${BASH_COMMAND}"; exit ${STATUS}' ERR | |
trap 'rm -rf ${tempDir}' EXIT | |
readonly supportedUbuntuVersion="22.04" | |
readonly tempDir="/tmp/setup" | |
readonly devDir="${HOME}/dev" | |
readonly scriptsDir="${devDir}/scripts" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# benchmarking the new parsnip release 1.0.3 vs previous 1.0.2 | |
# | |
# forked from: @simonpcouch | |
# https://gist.github.com/simonpcouch/651d0ea4d968b455ded8194578dabf52 | |
# gist name:simonpcouch/parsnip_speedup.R | |
# 2022-11-22 | |
# | |
library(tidymodels) | |
# with v1.0.2 ------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see: https://www.youtube.com/watch?v=RYhwZW6ofbI&t=6s | |
# R tip #3: use pipe connections | |
# by jim Hester | |
library(data.table) # for files < ~10GB | |
library(skimr) # another summary() | |
# filter a file: get only lines containing word UNK | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -O /tmp/YaHei.Consolas.1.12.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/uigroupcode/YaHei.Consolas.1.12.zip | |
unzip /tmp/YaHei.Consolas.1.12.zip | |
sudo mkdir -p /usr/share/fonts/consolas | |
sudo mv YaHei.Consolas.1.12.ttf /usr/share/fonts/consolas/ | |
sudo chmod 644 /usr/share/fonts/consolas/YaHei.Consolas.1.12.ttf | |
cd /usr/share/fonts/consolas | |
sudo mkfontscale && sudo mkfontdir && sudo fc-cache -fv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# pip install crossrefapi | |
from crossref.restful import Works | |
import requests | |
""" | |
Simple client for CrossRef DOI content negotiation | |
Tries to resolve a given DOI with CrossRef API. | |
If it fails (e.g. DOI is not minted by the CrossRef agency), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Node.js CheatSheet. | |
// Credit: | |
// forked from Github gist: devmoreno/CheatCheat.js | |
// source URL: https://gist.github.com/devmoreno/f8db88351bc10e2a82e02dc0b06e68dd | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ls='exa --classify --across' | |
alias l='exa --classify --oneline' | |
alias ll='exa --classify --long --group' | |
alias llg='exa --classify --long --grid --group' | |
alias tree='exa --classify --tree' | |
alias lrt='exa --classify --long --group --sort newest' | |
# When --long --grid are used at the same time, --grid will only apply if the | |
# resulting output will be at least EXA_GRID_ROWS long. | |
export EXA_GRID_ROWS=3 |
NewerOlder