Skip to content

Instantly share code, notes, and snippets.

@gagarine
gagarine / fish_install.md
Last active April 17, 2024 20:06
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@lukecav
lukecav / functions.php
Created September 15, 2017 19:59
Bypass logout confirmation in WooCommerce
function wc_bypass_logout_confirmation() {
global $wp;
if ( isset( $wp->query_vars['customer-logout'] ) ) {
wp_redirect( str_replace( '&', '&', wp_logout_url( wc_get_page_permalink( 'myaccount' ) ) ) );
exit;
}
}
add_action( 'template_redirect', 'wc_bypass_logout_confirmation' );
@biinari
biinari / extract-123-reg-zonefile.js
Last active February 8, 2023 14:23
Script to extract the DNS entries from 123-reg advanced dns page
// Moved to a new home at https://github.com/biinari/zonefile-extract/tree/master/123-reg
@bender-the-greatest
bender-the-greatest / time-function.ps1
Last active November 4, 2022 11:54
Alternative implementation of Measure-Command, works similarly to Linux `time` command
# Alternative (improved?) implementation of Measure-Command
# Works similarly to the Linux/Unix `time` command
#
# Function which times how long a command takes to completion
# Note that this function outputs to Write-Host so as to
# protect the proper return value. Note that a time will be
# returned even if the command fails.
#
# Unless `-quiet` is specified, command output is sent directly
# to `Write-Host` to allow for the simultaneous return of the
@adamghill
adamghill / apps.py
Last active May 5, 2022 09:03
Watch .env file for changes in a Django app
from django.apps import AppConfig
from django.conf import settings
from django.utils.autoreload import autoreload_started
class Config(AppConfig):
name = "random_app_name"
def ready(self):
autoreload_started.connect(watch_env)
MOVED TO ⮕ https://github.com/erikw/restic-automatic-backup-scheduler
@dropwhile
dropwhile / results.txt
Last active March 10, 2020 21:01
python compression comparison
Data Size:
Input: 2074
LZ4: 758 (0.37)
Snappy: 676 (0.33)
LZF: 697 (0.34)
ZLIB: 510 (0.25)
LZ4 / Snappy: 1.121302
LZ4 / LZF: 1.087518
LZ4 / ZLIB: 1.486275
Benchmark: 50000 calls