Skip to content

Instantly share code, notes, and snippets.

View mohammedmatar's full-sized avatar
🤾‍♂️
Only one who wanders finds new paths.

❁ Mohammed Matar ❁ mohammedmatar

🤾‍♂️
Only one who wanders finds new paths.
View GitHub Profile
@mohammedmatar
mohammedmatar / compress.js
Created September 1, 2020 12:57 — forked from aldo-roman/compress.js
Brotli compression with Angular CLI
const brotli = require('brotli')
const fs = require('fs')
const brotliSettings = {
extension: 'br',
skipLarger: true,
mode: 1, // 0 = generic, 1 = text, 2 = font (WOFF2)
quality: 10, // 0 - 11,
lgwin: 12 // default
}
@mohammedmatar
mohammedmatar / README.md
Created April 18, 2020 03:58 — forked from twolfson/README.md
Script to upload images to Imgur via curl

With visual testing we occasionally need to debug images in CI environments. We were previously using Imgur's v1 API:

https://github.com/twolfson/twolfson.com/blob/3.102.0/test/perceptual-tests/upload-screenshots.sh

but that's been shutdown and v2 and v3 seems like they need login for uploading images. We don't like that since these are rarely setup and we don't want to associate development content with personal content.

Thankfully Imgur supports uploading images via the browser without logging in. After trial/error, we got the following script for uploading a single image:

#!/usr/bin/env bash
@mohammedmatar
mohammedmatar / linux-power-management
Created July 2, 2018 23:37
Power management configs for Arch Linux (without laptop-mode-tools, powertop, etc)
## Preamble
There are lots of tools out there that set power management, some more transparent (powertop), some less so (laptop-mode). Often it is hard to know what exactly the tool is doing to improvement power management. Here I would like to document some of the things I do to improve power efficiency and sometimes performance as well.
/etc/sysctl.d/99-sysctl.conf
> # To fix Dropbox not being able to handle too many files
> fs.inotify.max_user_watches = 524288
>
> # VM writeback timeout (suggestion from powertop: In hundredths of a second, this is how often pdflush wakes up to write data to disk.)
> vm.dirty_writeback_centisecs = 1500