mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
chore: add binary folder
This commit is contained in:
48
bin/gource-gravatars
Executable file
48
bin/gource-gravatars
Executable file
@@ -0,0 +1,48 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#fetch Gravatars
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use LWP::Simple;
|
||||||
|
use Digest::MD5 qw(md5_hex);
|
||||||
|
|
||||||
|
my $size = 90;
|
||||||
|
my $output_dir = '.git/avatar';
|
||||||
|
|
||||||
|
die("no .git/ directory found in current path\n") unless -d '.git';
|
||||||
|
|
||||||
|
mkdir($output_dir) unless -d $output_dir;
|
||||||
|
|
||||||
|
open(GITLOG, q/git log --pretty=format:"%ae|%an" |/) or die("failed to read git-log: $!\n");
|
||||||
|
|
||||||
|
my %processed_authors;
|
||||||
|
|
||||||
|
while(<GITLOG>) {
|
||||||
|
chomp;
|
||||||
|
my($email, $author) = split(/\|/, $_);
|
||||||
|
|
||||||
|
next if $processed_authors{$author}++;
|
||||||
|
|
||||||
|
my $author_image_file = $output_dir . '/' . $author . '.png';
|
||||||
|
|
||||||
|
#skip images we have
|
||||||
|
next if -e $author_image_file;
|
||||||
|
|
||||||
|
#try and fetch image
|
||||||
|
|
||||||
|
my $grav_url = "http://www.gravatar.com/avatar/".md5_hex(lc $email)."?d=404&size=".$size;
|
||||||
|
|
||||||
|
warn "fetching image for '$author' $email ($grav_url)...\n";
|
||||||
|
|
||||||
|
my $rc = getstore($grav_url, $author_image_file);
|
||||||
|
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
|
if($rc != 200) {
|
||||||
|
unlink($author_image_file);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close GITLOG;
|
||||||
12
bin/highlights-sync
Executable file
12
bin/highlights-sync
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd $HOME/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/Highlights/
|
||||||
|
gstatus=`git status --porcelain`
|
||||||
|
|
||||||
|
if [ ${#gstatus} -ne 0 ]
|
||||||
|
then
|
||||||
|
git add --all
|
||||||
|
git commit -m `date +%Y-%m-%d-%H%m%S`
|
||||||
|
git pull --rebase
|
||||||
|
git push
|
||||||
|
fi
|
||||||
11
bin/screenshot
Executable file
11
bin/screenshot
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Create a set of screenshots from a URL
|
||||||
|
# Usage: screenshot <url>
|
||||||
|
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
echo 1>&2 Usage: screenshot \<url\> \(parameters\)
|
||||||
|
exit 127
|
||||||
|
fi
|
||||||
|
|
||||||
|
pageres 375x667 768x1024 1280x800 $*
|
||||||
12
bin/zettelkasten-sync
Executable file
12
bin/zettelkasten-sync
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd $HOME/Library/Mobile\ Documents/iCloud\~md\~obsidian/Documents/Zettelkasten/
|
||||||
|
gstatus=`git status --porcelain`
|
||||||
|
|
||||||
|
if [ ${#gstatus} -ne 0 ]
|
||||||
|
then
|
||||||
|
git add --all
|
||||||
|
git commit -m `date +%Y-%m-%d-%H%m%S`
|
||||||
|
git pull --rebase
|
||||||
|
git push
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user