Skip to content

Instantly share code, notes, and snippets.

View alexblackie's full-sized avatar

Alex Blackie alexblackie

View GitHub Profile
@alexblackie
alexblackie / cloc-per-directory.rb
Last active May 31, 2021 17:20
cloc stats per directory
require 'csv'
require 'json'
# Generate stats.csv with `cloc`:
#
# cloc --csv --by-file --report-file stats.csv .
# CSV row:
# language,filename,blank,comment,code,version
@alexblackie
alexblackie / jellybeans.ini
Created January 28, 2016 06:14
Gnome Terminal profile for jellybeans
# dconf dump /org/gnome/terminal/legacy/profiles:/
[:b1dcc9dd-5262-4d8d-a863-c897e6d979b9]
foreground-color='rgb(173,173,173)'
visible-name='Jellybeans'
login-shell=true
palette=['rgb(59,59,59)', 'rgb(207,106,76)', 'rgb(153,173,106)', 'rgb(216,173,76)', 'rgb(89,123,197)', 'rgb(160,55,176)', 'rgb(113,185,248)', 'rgb(173,173,173)', 'rgb(99,99,99)', 'rgb(247,146,116)', 'rgb(193,213,146)', 'rgb(255,213,116)', 'rgb(129,163,237)', 'rgb(200,95,216)', 'rgb(153,225,255)', 'rgb(213,213,213)']
default-size-rows=45
default-size-columns=160
use-system-font=false
use-theme-colors=false
@alexblackie
alexblackie / userChrome.css
Last active April 27, 2018 14:14
Improve spacing and padding in Firefox 60 CSD in GNOME
/**
** Usage:
* 1. Create "$HOME/.mozilla/firefox/*.default/chrome/" if it doesn't exist
* 2. Place this stylesheet as: $HOME/.mozilla/firefox/*.default/chrome/userChrome.css
* 3. Restart Firefox.
*/
#TabsToolbar {
--space-above-tabbar: 10px;
}
@alexblackie
alexblackie / transcode.rb
Last active February 20, 2018 02:21
This is how I manage my music library. SHA256 hashes as filenames, transcoded to MP3@320K, is what gets distributed to my phones, laptops, etc. FLAC/MP3 masters get left on the NAS.
# vim: ts=4 sw=4 noexpandtab
require "digest"
require "fileutils"
class Transcoder
CONCURRENCY = 8.freeze
DEFAULT_OUTPUT_DIR = File.join(File.dirname(__FILE__), "..", "mp3s").freeze
MANIFEST_FILE = ".transcode.manifest".freeze
MANIFEST_DELIMITER = "||".freeze
mkdir softwarez ; cd softwarez
rpm --root `pwd` --initdb
dnf download --destdir=var/tmp fedora-release
sudo rpm --root `pwd` -ih --nodeps var/tmp/fedora-release-25-1.noarch.rpm
sudo dnf install --installroot=`pwd` -y vim
./usr/bin/vim
@alexblackie
alexblackie / system.pa.diff
Created March 18, 2016 05:42
Closest I could get to completely disabling ducking in Pulseaudio on Fedora 23 (GNOME) -- `git diff /etc/pulse/system.pa ~/.config/pulse/system.pa`
diff --git a/etc/pulse/system.pa b/home/alex/.config/pulse/system.pa
index 903aa39..92b10f7 100644
--- a/etc/pulse/system.pa
+++ b/home/alex/.config/pulse/system.pa
@@ -54,3 +54,7 @@ load-module module-suspend-on-idle
### Enable positioned event sounds
load-module module-position-event-sounds
+
+### FUCK YOUR FUCKING DUCKING ###
@alexblackie
alexblackie / post-receive.sh
Created January 31, 2013 09:39
Deploy a Middleman site by building it server-side on a Git post-receive (making deployment as easy as "git push").
#!/bin/sh
# Simply point your virtualhost to the GIT_WORK_TREE below, with "/build" appended. (ex: /path/to/webroot/example.com/build)
# This is how I manage all of my sites. I highly recommend this setup.
GIT_WORK_TREE=/path/to/webroot/example.com # Set this to your webroot path (sans build)
export GIT_WORK_TREE
git checkout -f
# Enter Directory
@alexblackie
alexblackie / putty.ini
Last active June 9, 2016 01:49
Sane defaults for Putty
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\Sessions\Default%20Settings]
"UserName"="alex"
"FullScreenOnAltEnter"=dword:00000001
"Beep"=dword:00000000
"BeepInd"=dword:00000000
"TermWidth"=dword:00000096
"TermHeight"=dword:00000028
"Font"="Consolas"
#!/bin/sh
#####################################
# Getting cmus running on Fedora 23 #
#####################################
# Get the things
git clone https://github.com/cmus/cmus.git && cd cmus
# Install required headers

Keybase proof

I hereby claim:

  • I am alexblackie on github.
  • I am alexblackie (https://keybase.io/alexblackie) on keybase.
  • I have a public key whose fingerprint is 62C5 2F68 3634 47D9 71C6 29ED A231 E0F2 D35D 0D47

To claim this, I am signing this object: