Skip to content

Instantly share code, notes, and snippets.

shannietron /
Created Jul 10, 2020
make your files look like they went through dead trees.
function makeScanned
convert -density 150 $argv[1] -colorspace gray -linear-stretch 3.5%x10% -blur 0x0.5 -attenuate 0.25 +noise Gaussian -rotate 0.5 temp.pdf
gs -dSAFER -dBATCH -dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite -sColorConversionStrategy=LeaveColorUnchanged dAutoFilterColorImages=true -dAutoFilterGrayImages=true -dDownsampleMonoImages=true -dDownsampleGrayImages=true -dDownsampleColorImages=true -sOutputFile=output.pdf temp.pdf
#idea from this HN thread
shannietron / doubleDabble.c
Created Dec 22, 2018
Implementation of the double dabble algorithm to convert binary to BCD.
View doubleDabble.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *binary(unsigned int dec);
int main(int argc, char * argv [] ){
unsigned int input = strtol(argv[1],NULL,10);
unsigned int temp = 0x0;

Keybase proof

I hereby claim:

  • I am shannietron on github.
  • I am shannietron ( on keybase.
  • I have a public key ASC_6j4_fXThxThWHawNnGjFKTT5Vzobr-EwbOpJViMwHwo

To claim this, I am signing this object:

shannietron /
Last active Nov 12, 2018
Youtube downloader
function ytplay
youtube-dl -f bestaudio $argv[1] -o - | mplayer -
shannietron / streamTube
Created May 4, 2016
Streams youtube videos using youtube-dl and mplayer
View streamTube
while read line
echo "Playing - $name"
youtube-dl -f 141 $name -o - | mplayer -
# youtube-dl -x --audio-format mp3 --audio-quality 0 -o "%(title)s.%(ext)s" $name
done < $1
shannietron /
Last active Aug 29, 2015
Calculate how much power your Macbook is nomming.
function power
set amp (system_profiler SPPowerDataType | awk '/Amperage/{ print $3 }')
set volt (system_profiler SPPowerDataType | awk '/Voltage/{ print $3 }')
set power (echo "scale=2; ($volt * $amp)/1000000"| bc -l)
echo $power"W"