Skip to content

Instantly share code, notes, and snippets.

@mitchellh
mitchellh / merge_vs_rebase_vs_squash.md
Last active November 11, 2024 17:07
Merge vs. Rebase vs. Squash

I get asked pretty regularly what my opinion is on merge commits vs rebasing vs squashing. I've typed up this response so many times that I've decided to just put it in a gist so I can reference it whenever it comes up again.

I use merge, squash, rebase all situationally. I believe they all have their merits but their usage depends on the context. I think anyone who says any particular strategy is the right answer 100% of the time is wrong, but I think there is considerable acceptable leeway in when you use each. What follows is my personal and professional opinion:

@JamieMair
JamieMair / JuliaConFavsICS.md
Last active July 9, 2024 11:12
Downloading a favourited calendar ICS for JuliaCon2023

Guide

I couldn't find a way to download only my favourited talks, so I wrote a script, found in this gist. Below are instructions of how to use it for yourself.

  1. Go to https://pretalx.com/juliacon2023/schedule/ to choose your schedule and favourite the talks you want in your calendar.
  2. Next, go to the cookies page by opening up the dev tools (usually F12). I found my favourited talks on Firefox in Storage -> Local Storage -> "juliacon2023_favs" and copied the JSON array directly in the script.
  3. Paste in the array found in the cookies to your copy of the file below.
  4. Download your ICS calendar file by clicking the down arrow next to the Version number in the same folder as the script downloaded. I called my file "schedule.ics".
  5. Run the script with your favourited list and you should get a new file called "my_schedule.ics". Check to see if the talks are the ones you want.
  6. Download the ICS to your phone / import them to your calendar app of choice.
@Kranzes
Kranzes / guide.md
Last active November 14, 2024 08:26
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@sminot
sminot / print_nextflow_logs.sh
Created January 14, 2022 18:26
Print the log file from a Nextflow task using its short hash
#!/bin/bash
set -euo pipefail
WORK_DIR="${1}"
# Input is the short task id prefix
TASK_PREFIX="${2}"
# Get the complete suffix
@MateusRodCosta
MateusRodCosta / Improved Microphone (Male voices, with Noise Reduction).json
Last active October 11, 2024 12:12
An EasyEffects preset created for input devices (intended for Microphones). Please read the README.md.
{
"input": {
"blocklist": [],
"compressor": {
"attack": 20.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"hpf-frequency": 10.0,
"hpf-mode": "off",
"input-gain": 0.0,
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
################################################################################
# System
@hkarl
hkarl / paperpile.sh
Created May 24, 2021 13:03
How to process paper pile-exported bibfiles so that emacs / helm-bibtex / ivy-bibtex can work with them.
#!/bin/bash
# Get the newest paperpile and fix the format
# Argument 1: Paperpile folder name to look for
# This is messy because paperpile insists on putting spaces in file names and gnu make can't handle that :-(
# This is also messy because paperpile has such a weird file format; not really compatible with ivy-bibtex / helm-bibtex in emacs.
@bmcbm
bmcbm / setup-nvdia-suspend.sh
Last active November 17, 2024 00:59
NVIDIA Suspend fix
# Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<=====
# https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html
# https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306
# Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage
# as sugested by @goombah88 in the comments below.
TMP_PATH=/var/tmp
TMPL_PATH=/usr/share/doc/nvidia-driver-460/
echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf
@yihuang
yihuang / Cargo.toml
Last active September 25, 2024 02:14
build rust project using bindgen with nix
[package]
name = "test-rust"
version = "0.1.0"
authors = ["yihuang <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
@CrystalGamma
CrystalGamma / configuration.nix
Created January 11, 2020 01:19
NixOS on PBP
{ config, lib, pkgs, ... }: let do_graphical = true; in {
imports = [./hardware-configuration.nix];
nix = {
maxJobs = 2;
buildCores = 6;
buildMachines = [{
hostName="rockpro64-nixos.local";
sshUser="nixdistbuild";
sshKey="/root/.ssh/id_buildmaster";
system="aarch64-linux";