Skip to content

Instantly share code, notes, and snippets.

View bsmirnov's full-sized avatar

Boris Smirnov bsmirnov

View GitHub Profile
@skyzyx
skyzyx / homebrew-gnubin.md
Last active June 29, 2024 15:22
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

My 2Do tasks

This is just contents of my never ending lists of tasks I tagged in 2Do with read, watch and check tags.

All lists are sorted by priority. I hope to bring all these lists closer to 0 when I get time. But until then, perhaps you will find something interesting in them.

Here are the lists I share so far.

@sts10
sts10 / alacritty.yml
Last active December 20, 2023 13:54
My Alacritty config yml for MacOS (compliant with v 0.4.1-dev)
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.
#
@vdbelt
vdbelt / cloudflare-purge-cache-service-worker.js
Created August 21, 2018 11:43
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
@illepic
illepic / particle-deps.sh
Last active May 18, 2022 21:50
Particle from scratch with all dependencies
#!/usr/bin/env bash
# 1. Skip steps if you already have the tools listed
# 2. Run source ~/.bashrc or source ~/.zshrc after each step to ensure command is registered
# Install Homebrew, if not installed
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Update Homebrew installed packages
brew update && brew upgrade
@steven2358
steven2358 / ffmpeg.md
Last active June 23, 2024 18:17
FFmpeg cheat sheet
@bryanbraun
bryanbraun / reset_hook_post_update_NAME.drush
Created June 19, 2017 20:24
A drush script for reseting post_update hooks. For more details, see https://drupal.stackexchange.com/q/238682/11788
#!../vendor/bin/drush
// <?php
// ^^^ For syntax highlighters only
//
// This is a drush shell script, designed to help debug and reset post_update
// hooks. For details, see: http://www.drush.org/en/master/shellscripts/
$key_value = \Drupal::keyValue('post_update');
$update_list = $key_value->get('existing_updates');
@gholms
gholms / buttond.py
Last active October 3, 2021 02:02
Unifi wireless voucher generator and requestor button
#!/usr/bin/python3
# Copyright 2017 William Klope
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License or (at your
# option) any later version accepted by the Santa Barbara Hackerspace (or
# its successor approved by the Santa Barbara Hackerspace), which shall
# act as a proxy as defined in Section 14 of version 3 of the license.
@knadh
knadh / zsh-elapsed-time.md
Last active May 30, 2024 12:32
Elapsed and execution time for commands in ZSH

Elapsed and execution time display for commands in ZSH

Append this to your ~/.zshrc file.

function preexec() {
 timer=$(($(date +%s%0N)/1000000))

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?