Skip to content

Instantly share code, notes, and snippets.

View patriknyblad's full-sized avatar

Patrik Nyblad patriknyblad

View GitHub Profile
@patriknyblad
patriknyblad / squash-git-history-before-hash.sh
Created June 16, 2023 11:51
Squashes git history before a specified hash in a new branch and cherry picks all newer history
#!/bin/bash
# Specify the name of the branch you want to squash the history for
BRANCH_NAME=$1
# Specify the name of the new branch
NEW_BRANCH_NAME=$2
# Specify cutoff hash
CUTOFF_HASH=$3
[global]
# https://eggplant.pro/blog/faster-samba-smb-cifs-share-performance/
# FORCE THE DISK SYSTEM TO ALLOCATE REAL STORAGE BLOCKS WHEN
# A FILE IS CREATED OR EXTENDED TO BE A GIVEN SIZE.
# THIS IS ONLY A GOOD OPTION FOR FILE SYSTEMS THAT SUPPORT
# UNWRITTEN EXTENTS LIKE XFS, EXT4, BTRFS, OCS2.
# IF YOU USE A FILE SYSTEM THAT DOES NOT SUPPORT UNWRITTEN
# EXTENTS, SET "strict allocate = no".
@patriknyblad
patriknyblad / xcrun_simctl_cheatsheet.md
Last active May 6, 2024 07:01
iOS Simulator Terminal Commands `$ xcrun simctl`

Managing iOS Simulators

List all simulators created

$ xcrun simctl list --json

Delete old and unavailable simulators

$ xcrun simctl delete unavailable
@patriknyblad
patriknyblad / Testing
Last active November 7, 2017 23:15
Types of tests you can write
# Testing
When writing automated tests there is a sea of terms out there for what your tests are doing or aim to do.
This gist is here as a cheat sheet for future reference.
## Unit test
Tests a small unit of the code, one test typically tests one branch (if, switch, for etc.) in one method.
Dependencies and interactions should be mocked to not affect the outcome of the test or invoke things
outside of the scope of the test.