Skip to content

Instantly share code, notes, and snippets.

View gcdr's full-sized avatar
😀
Better!

Glen Ritchie gcdr

😀
Better!
View GitHub Profile
layout title description path
barewithrelated
Book Authoring Using GitHub and Git
Formats, tips and techniques for using GitHub and Git as the version control and collaborative platform for writing short and long form books.
usecases/_posts/2001-01-01-book-authoring-using-git-and-github.md

GitHub and Git are not just for writing programming code. They can also be an effective tool for writing articles and books. Matthew McCullough has written a quick guide to writing books in lightweight formats. This article will be folded into this Teaching repository over the coming months.

What is this?

@gcdr
gcdr / Pulling 3 digits
Created June 4, 2020 21:41
MMA snippet
Table[RandomSample[{1,2,3,4},3],{10}]
@gcdr
gcdr / CMD of Day Jul-12
Last active May 4, 2020 20:20
CMD of Day Jun-12 2019
:g/^$/d
# vim remove blank lines, all of them
# Source: https://alvinalexander.com/linux-unix/vi-vim-delete-blank-lines-empty-lines
@gcdr
gcdr / CMD of Day Jul-01
Last active June 2, 2020 00:33
CMD of Day Jul-01 2019
Emacs
Press Ctrl-L
# If you use Emacs a lot? Try this key-binding.
# You'll ask yourself. Why didn't someone tell me of that, first thing.
# All word processors or 'word processors' should have this feature!
@gcdr
gcdr / CMD of Day Jun-29
Last active May 4, 2020 20:21
CMD of Day Jun-29 2019
:set tw=99999
gggqG
# Citing: https://superuser.com/questions/200423/join-lines-inside-paragraphs-in-vim
# Title: Join lines inside paragraphs in vim
@gcdr
gcdr / CMD of Day Jun-30
Last active May 4, 2020 20:21
CMD of Day Jun-30 2019
sed "s/\([a-zA-Z]*\)[?]\([a-zA-Z]*\)/\1'\2/g" <parts1.txt >parts2.txt
# Hard sed, changes don?t to don't in parts file.
# It will change the time? to; the time' # Not wanted, WIP
@gcdr
gcdr / CMD of Day Jun-25
Last active May 4, 2020 20:21
CMD of Day Jun-25 2019
head -100 file3.lst | tr '\n' '\0' | tar --null --no-recursion -uf ~mov3.tar -T -
# create tarball only of files in file3.lst
# forms like ??, are quoted by it.
Data:
./Baking/Sides/Radix/Gcdr Swish/GitBook Templates Collection (67)/GitBook Templates Collection - Gcdr Swish.epub
@gcdr
gcdr / CMD of Day Jun-17
Last active May 4, 2020 20:16
CMD of Day Jun-17 2019
git log --name-only --oneline --color=always | less
# See which files "commit" after in log.
# Credit: link:https://matthewsetter.com/4-basic-git-commandline-tips/[4 Git Command-Line Tips for Greater Productivity]
# --
# Run that. Want to see nice color.
# Add this to .bashrc
# --
# LESSOPEN="|/usr/bin/lesspipe.sh %s"; export LESSOPEN
@gcdr
gcdr / Vim Gist
Last active January 27, 2019 20:12
Vim code re-format
Paste this in, enter : command mode, of course.
map <F7> gg=G<C-o><C-o>