Skip to content

Instantly share code, notes, and snippets.

View lumotroph's full-sized avatar
💭
waiting for assays, writing code...

Duncan lumotroph

💭
waiting for assays, writing code...
  • Johannesburg, South Africa
  • 12:33 (UTC +02:00)
View GitHub Profile
@eYinka
eYinka / tailwind-radial-progress-bar.txt
Last active November 7, 2024 08:54
Tailwind CSS Radial Progress Bar
// Inspired by Tailwind Daisy UI progress bar: https://daisyui.com/components/radial-progress/
// This is a custom-made progress circular/radial progress bar with centered percentage text.
// Tested with Tailwind 3.x. Should work with lower versions of Tailwind CSS as well.
STEP 1: Add the following custom CSS:
.progress-ring__circle {
transition: stroke-dashoffset 0.35s;
transform: rotate(-90deg);
transform-origin: 50% 50%;
@macninja
macninja / rpi-hdmi.sh
Last active October 22, 2023 12:32
Enable and disable the HDMI port on the Raspberry Pi. Uses cec-hdmi. Works on Raspberry Pi 4 as well.
#!/bin/bash
# Enable and disable HDMI output on the Raspberry Pi
# The script uses the cec-hdmi command to manage the hdmi interface.
# https://pimylifeup.com/raspberrypi-hdmi-cec/
# On a Raspberry Pi 4 i could only get this to work if i used the hdmi 2 port.
# To setup the script run "echo 'scan' | cec-client -s -d 1" to identify the adress of the HDMI unit.
@dcchambers
dcchambers / md2pdf.md
Last active September 5, 2024 07:02
Generate a PDF from Markdown files with Pandoc

Generate a PDF from a Markdown file with Pandoc

Easy Steps For Mac OS

  1. Have Homebrew installed and a markdown file you want to render to PDF.
  2. Install Pandoc brew install pandoc
  3. Install basictex brew cask install basictex - needed for the pdflatex tool.
  4. Symlink the pdflatex to your /usr/local/bin so pandoc can easily find it. ln -s /Library/TeX/Root/bin/x86_64-darwin/pdflatex /usr/local/bin/pdflatex
  5. Use Pandoc to generate a PDF from a Markdown file. pandoc input.md -o output.pdf
  • By default the margins are pretty large. To optionally change the margins: pandoc input.md -o output.pdf -V geometry:margin=1in
@Adam--
Adam-- / adb_screenshot.bat
Last active May 31, 2024 07:15
Take an Android screenshot using ADB on Windows
adb devices
adb shell screencap -p /sdcard/screen.png
adb pull -p -a /sdcard/screen.png
adb shell rm /sdcard/screen.png
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-3 delims=/:" %%a in ("%TIME%") do (set mytime=%%a-%%b-%%c)
set mytime=%mytime: =%
@renatorib
renatorib / operator_with_ligatures.md
Last active January 11, 2024 06:45
Using Operator Mono with Fira Code ligatures in Atom.

Using Operator Mono with Fira Code ligatures in Atom.

  1. Open your Atom's Stylesheet
    image

  2. Put this css

atom-text-editor {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
@andreibosco
andreibosco / creative-cloud-disable.md
Last active August 29, 2024 03:27
disable creative cloud startup on mac
@avillp
avillp / Unportify-v1.4.3.js
Last active November 12, 2023 15:22
Unportify helps you export your Google Play Music playlists.
/*
Unportify is a script that exports your Google Play music to text.
Copyright (C) 2016 Arnau Villoslada
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@jherax
jherax / array-sort-by.1.ts
Last active July 19, 2024 00:12
Sorts an array with multiple ordering criteria (Schwartzian transform)
/**
* Sorts an array of objects In-Place,
* sorting by multiple fields sequentially.
*
* @description This function is meant to be used
* with arrays of objects, AND when you need to set
* multiple sorting criteria. For other cases it is
* recommended to use the native method `array.sort(callback)`
* since for simple cases this function is more expensive
* in time and memory.
@davidbradway
davidbradway / rpi.md
Last active June 19, 2021 11:30
Raspberry Pi setup commands
startx
ifconfig
sudo nano /etc/network/interfaces 
sudo ifconfig
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git

# Setup some Python stuff