Skip to content

Instantly share code, notes, and snippets.

View ah-cog's full-sized avatar

Ashley Hayes ah-cog

  • San Francisco, California
View GitHub Profile
@ah-cog
ah-cog / uuid-lowercase.sh
Last active March 19, 2022 09:25
Generate random UUID with lowercase characters.
#!/bin/sh
uuidgen | awk '{print tolower($0)}'
@ah-cog
ah-cog / short-uuid-8.sh
Created March 19, 2022 09:24
Generate random UUID and extract first group (8 characters)
#!/bin/sh
uuidgen | awk '{print tolower($0)}' | sed s/-/\\n/g | head -n 1
@ah-cog
ah-cog / how-to.txt
Created December 12, 2020 10:40 — forked from simonw/how-to.md
How to create a tarball of a git repository using "git archive"
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
@ah-cog
ah-cog / split_silence.sh
Created April 18, 2020 03:44 — forked from jochemstoel/split_silence.sh
Guide to split audio recording by silence with SoX and ffmpeg
# First denoise audio
## Get noise sample
ffmpeg -i input.ogg -vn -ss 00:00:00 -t 00:00:01 noise-sample.wav
## Create noise profile
sox noise-sample.wav -n noiseprof noise.prof
## Clean audio from noise
sox input.ogg clean.wav noisered noise.prof 0.21
// ----------------------------------------------------------------------------
//
// Organizations.
//
// ----------------------------------------------------------------------------
@ah-cog
ah-cog / javascript-set-operations.md
Created September 21, 2018 02:47
JavaScript Set Operations

Union

let a = new Set([1,2,3]);
let b = new Set([4,3,2]);
let union = new Set([...a, ...b]);
    // {1,2,3,4}

Intersection

@ah-cog
ah-cog / 0fixup.md
Created June 22, 2018 21:34 — forked from silent1mezzo/0fixup.md
On undoing, fixing, or removing commits in git

A git choose-your-own-adventure!

This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.

@ah-cog
ah-cog / install-hamachi-and-haguichi-on-ubuntu-16.04
Created November 2, 2017 21:51
Install Hamachi and Haguichi on Ubuntu 16.04
- install lsb
- install openssh-server (for SSH access via Haguichi)
- install samba
- configure /etc/smb.conf: add to interfaces
- add samba user: `sudo smbpasswd -a mgub` (use to log into share from Hamachi/Haguichi)
- install hamachi and login
- install Haguichi
@ah-cog
ah-cog / ubuntu-16.04-configuration.md
Last active November 3, 2017 03:30
Ubuntu 16.04 Configuration

Cinnamon Theme Settings

Install Ubuntu Cinnamon. Follow these instructions.

These settings are set in System Settings > Themes.

  • Window borders: Arc-Darker (Alternative: Numix)
  • Icons: Numix-Square
  • Controls: Arc-Darker (Alternative: Numix)
  • Mouse Pointer: DMZ-White
  • Desktop: Arc-Dark (Alternative: Numix-Cinnamon-Transparent)
@ah-cog
ah-cog / install-pygit2-on-ubuntu-16.04.md
Last active October 1, 2017 00:21 — forked from bendavis78/gist:3157948
Installing pygit2 on Ubuntu 16.04

Download and build libgit2

cd ~/.local/src/
git clone git://github.com/libgit2/libgit2.git 
cd libgit2
mkdir build && cd build
cmake ..
cmake --build .

If debugging, use the following cmake commands instead: