Skip to content

Instantly share code, notes, and snippets.

View patdavid's full-sized avatar

Pat David patdavid

View GitHub Profile
@patdavid
patdavid / GIMP FAQ
Last active August 29, 2015 14:15 — forked from prokoudine/GIMP FAQ.md
**Can I use GIMP commercially?**
Yes, you can. GIMP is free software, it doesn't put restrictions on the kind
of work you produce with it.
**What's the GNU GPL license, and how do I comply with it?**
* You are free to use GIMP, for any purpose
* You are free to distribute GIMP
* You can study how GIMP works and change it
@patdavid
patdavid / test-gist.md
Created February 18, 2016 18:39
Testing gist

Testing something

Not sure that this will work the way I expect it to...

@patdavid
patdavid / bash-rename-list
Created October 4, 2016 14:59
Rename a bunch of files including lines from an external file
while read -u 9 filename; do read -u 8 newname; mv "$filename.mkv" "$filename - $newname.mkv"; done 9<<<"$(ls -1 *.mkv | sed -e 's/\..*$//')" 8< namelist
@patdavid
patdavid / recursive-directories-mp3-gain
Created October 4, 2016 15:45
recursively find directories and apply mp3gain to all the .mp3 files inside
find ./ -type d -exec bash -c 'cd "$1"; mp3gain -a -k -m 3 *.mp3' -- {} \;
@patdavid
patdavid / patdavid-print-style.patch
Created December 8, 2016 17:28
PIXLS.US print style patch
From a89c508eb251a5a87793fad005fb17dfeba29be8 Mon Sep 17 00:00:00 2001
From: Pat David <patdavid@gmail.com>
Date: Thu, 8 Dec 2016 11:17:52 -0600
Subject: [PATCH] Work on print css styles
Fix the paragraph width issue (it was likely max-width being
set that was causing a problem).
Set all elements to 80% width of the container (div.column).
Set font to 14pt (12pt seemed too small when printing tests).

A test google link and some simple formatting.

A fenced code block, with language set to C++ ( ```C++):

#include "MIDIUSB.h"

#define ENCODER_PIN_A A3
#define ENCODER_PIN_B A2
#define NUMBER_CLICKS 30 // the number of clicks per rotation of the encoder
@patdavid
patdavid / scrape-digikam.py
Created March 21, 2017 22:15
Scraping the digikam website for news content to migrate to a new system
#!/usr/bin/python
from __future__ import unicode_literals
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
import datetime
import os
import re
import sys
@patdavid
patdavid / HTML_insert.vim
Created April 6, 2017 14:34 — forked from groenewege/HTML_insert.vim
vim - insert html
" Version 1.2
" Script create :IMG command, whitch insert HTML IMG tag
" with fill atributes width and height.
"
" It's need _identify_ utility from ImageMagic!
"
" (c) Petr Mach <gsl@seznam.cz>, 2003
" http://iglu.cz/wraith/
"
" Call it without parameter for file browser for selecting image.
function! ImgAttr()
" echo @"
" "normal "kyi'
" let tmp = @"
" let p = expand("%:p:h")
" let fullp = p .'/'. tmp
" "echo fullp
" let theWH=substitute(system('magick identify -format %wx%h "'.fullp.'"'),'\n','','')
" "let theData=substitute(theWH,'\([0-9]*\)x\([0-9]*\)', ' width="\1" height="\2" ','')
" let @y=substitute(theWH,'\([0-9]*\)x\([0-9]*\)', 'width="\1" height="\2" ','')
@patdavid
patdavid / gitlog
Created October 22, 2017 14:30
pretty git log
# From http://stackoverflow.com/questions/1838873/visualizing-branch-topology-in-git/34467298#34467298
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'