Skip to content

Instantly share code, notes, and snippets.

@nat-418
nat-418 / why-tcl.md
Last active April 1, 2024 03:23
Why Tcl?

Why Tcl?

Introduction

I use [Tcl] as my scripting language of choice, and recently someone asked me why. This article is an attempt to answer that question.

Ousterhout's dichotomy claims that there are two general categories of programming languages:

@nat-418
nat-418 / a-sensible-nixos-xfce-configuration.md
Last active April 5, 2025 04:21
A sensible NixOS Xfce configuration

A sensible NixOS Xfce Configuration

NixOS provides good support for the Xfce desktop environment out-of-the-box, but the defaults are minimal. The files in this Gist provide a more complete experience, including a suite of basic software and plugins as well as an optional home-manager configuration for theming.

The key additions to the default Xfce provided by NixOS are:

  • Complete bluetooth / audio support with panel indicators and apps
  • LightDM with theme
  • Extra Xfce apps for calendaring, disk partitioning, etc.
  • Various quality-of-life improving non-essentials
@ncdulo
ncdulo / youtube_title_grabber.py
Last active February 24, 2020 17:02
YouTube "URL -> Title" Scraper
#!/usr/bin/env python
import requests
import urllib.request
from bs4 import BeautifulSoup
'''When given a list of YouTube URLs inside `yt.txt`, this script will
use Requests and BeautifulSoup4 to iterate over that list of URLS and
scrape video titles from each link. The output is then appended on to
the same `yt.txt` input file. Because of this appendage action, note
that running this script multiple times on the same file will result in
@samueljon
samueljon / toggleHT.sh
Last active January 9, 2025 12:55
Disable / Enable HyperThreading cores on runtime - linux
#!/bin/bash
HYPERTHREADING=1
function toggleHyperThreading() {
for CPU in /sys/devices/system/cpu/cpu[0-9]*; do
CPUID=`basename $CPU | cut -b4-`
echo -en "CPU: $CPUID\t"
[ -e $CPU/online ] && echo "1" > $CPU/online
THREAD1=`cat $CPU/topology/thread_siblings_list | cut -f1 -d,`