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
  • 09:40 (UTC +02:00)
View GitHub Profile
@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 April 30, 2024 07:27
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 October 25, 2020 02:13
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 January 3, 2024 02:37
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 / sortBy.js
Last active May 31, 2021 07:50
Sorts an array with multiple ordering criteria (Schwartzian transform)
/**
* Sorts an array and allows multiple sorting criteria.
*
* It applies the Schwartzian transform:
* https://en.wikipedia.org/wiki/Schwartzian_transform
*
* Author: David Rivera
* Github: https://github.com/jherax
*
* You can fork this project on github:
@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