Skip to content

Instantly share code, notes, and snippets.

View matthewhartman's full-sized avatar

Matthew Hartman matthewhartman

View GitHub Profile
@matthewhartman
matthewhartman / install-fonts.txt
Created March 1, 2015 11:27
Install TTF Fonts in Debian
cd fonts
mv *.ttf /usr/share/fonts/truetype
cd /usr/share/fonts/truetype
mkfontscale
mkfontdir
fc-cache
xset fp rehash
@matthewhartman
matthewhartman / my-gulp-4-file.js
Last active June 2, 2021 20:35
My Gulp 4 File / Setup
const { watch, src, dest, parallel } = require('gulp');
const sass = require('gulp-sass');
const cssnano = require('cssnano');
const sourcemaps = require('gulp-sourcemaps');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
const concat = require('gulp-concat');
const browserSync = require('browser-sync');
const newer = require('gulp-newer');
const imagemin = require('gulp-imagemin');
@matthewhartman
matthewhartman / install-latest-curl-on-linux.markdown
Last active May 18, 2021 01:26
Latest CURL on Debian Linux

Download CURL from the following

https://curl.se/download.html

tar xzvf curl-7.68.0.tar.gz
cd curl-7.68.0
./configure --with-ssl
make
sudo make install
@matthewhartman
matthewhartman / format-commas.js
Created January 13, 2021 06:36 — forked from patik/format-commas.js
Format number with commas
// Converts `1234567` => `"1,234,567"
// Does not support decimals yet
function formatNumberWithCommas (number) {
return ('' + number) // Convert to a string
.split('').reverse().join('') // Reverse the order of the characters (which are all digits at this point)
.replace(/(...)/g, '$1,') // Insert a comma after every three digits
.split('').reverse().join('') // Un-reverse the characters
.replace(/^,/, ''); // Remove any commas that were added to the beginning (i.e. if the number of digits was a multiple of three)
};
@matthewhartman
matthewhartman / divider.js
Created October 8, 2020 05:37
Divider in JS
const divider = Array(20).join('-');
// output
// --------------------
@matthewhartman
matthewhartman / install-firefox-on-linux-debian.markdown
Created September 17, 2020 01:40
Install Firefox on Linux Debian

Install Firefox on Debian

Download firefox binary firefox-80.0.1.tar.bz2 and extract contents into /opt/ directory

sudo tar -xf firefox-*.tar.bz2 /opt/

Create symlink

@matthewhartman
matthewhartman / fix-crackling-for-pulseaudio-linux.markdown
Last active August 24, 2020 00:27
Fix Pulse Audio Crackling in Linux

Fix Pulse Audio Crackling in Linux

sudo nano /etc/pulse/default.pa

Find the following line:

load-module module-udev-detect

Running Docker on Ubuntu WSL

Configure Docker for Windows (Docker Desktop)

Windows Docker Settings

Install Docker in Ubuntu WSL

Update the apt package list

@matthewhartman
matthewhartman / install-yarn-linux-debian.markdown
Created August 5, 2020 23:25
Install Yarn on Linux (Debian)

Installing Yarn on Debian

Import the repository's GPG key

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

Enable the Yarn APT repository