Skip to content

Instantly share code, notes, and snippets.

View dlo's full-sized avatar
Always shipping.

Dan Loewenherz dlo

Always shipping.
View GitHub Profile
@UrsaDK
UrsaDK / Caching multi-stage builds in GA.md
Last active March 28, 2024 07:16
Speed up your multistage builds in GitHub Actions

Caching multi-stage builds in GitHub Actions

Caching Docker builds in GitHub Actions is an excellent article by @dtinth which analyses various strategies for speeding up builds in GitHub Actions. The upshot of the article is a fairly decisive conclusion that the best two ways to improve build times are:

  1. Build images via a standard docker build command, while using GitHub Packages' Docker registry as a cache = Longer initial build but fastest re-build times.

  2. Build your images via docker integrated BuildKit (DOCKER_BUILDKIT=1 docker build), while using a local registry and actions/cache to persist build caches = Fastest initial build but slightly longer re-build times.

The problem

@eyepaq
eyepaq / HealthKitImport.swift
Created February 25, 2018 03:50
Quick and dirty import of CSV data into HealthKit .bodyMass measurements. I used this to import my Withings health data export.
/**
Quick and dirty CSV importer, only used once by me to import my own data, sharing it here
in case anyone finds it useful.
*/
class HealthKitCSVImporter {
let healthStore = HKHealthStore()
let bodyMassType = HKSampleType.quantityType(forIdentifier: .bodyMass)!
func authorizeHealthKit(completion: @escaping ((_ success: Bool, _ error: Error?) -> Void)) {
@tanyuan
tanyuan / iterm2.md
Last active January 23, 2024 17:41
📺 iTerm2 tips & tricks

iTerm2 (The awesome terminal for Mac)

Look and feel

  • Window theme: Preferences > Appearance Tab > Theme > Light/Dark
  • Show folder icon on window title: Preferences > Appearance Tab > Window: Show proxy icon in window title bar
  • Background transparancy and blur: Preferences > Profiles Tab > Window Tab > Transparency (a third) & Blur (Checked, full)
  • Color theme: Preferences > Profiles Tab > Colors Tab > Color Presets...

Window and tab title

@smileyborg
smileyborg / InteractiveTransitionCollectionViewDeselection.m
Last active January 15, 2023 13:03
Animate table & collection view deselection alongside interactive transition (for iOS 11 and later)
// UICollectionView Objective-C example
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject];
if (selectedIndexPath != nil) {
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator;
if (coordinator != nil) {
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {
@62mkv
62mkv / Search-and-Replace-Structurally.md
Last active February 21, 2022 16:27
IntelliJ IDEA Receipts

Examples of Structural Search and Replace (IntelliJ IDEA 2017)

Use case 1 (Search)

Find all *DTO classes, that have a (at least one) public field that is neither @ApiModelProperty, nor a @JsonIgnore

  1. Open Edit->Find->Search structurally

  2. Paste this into Search template field:

@clatwell
clatwell / phvn-features.md
Created June 20, 2017 20:45
[PHVN] Features and Maintenance

Features

This is the primary list of things we hear about and also think would make sense for Posthaven.

  • Import from other blogs sites – primarily Wordpress a few requests for Tumblr and Medium
  • API – Primarily requested for blog post CRUD
  • Markdown support both in the online editor and when posting via email
  • Other types of payment than via credit card
@dlo
dlo / force_migration.sh
Last active November 6, 2016 14:14
For those of you who’ve run into the Xcode 8 / Swift migrator hanging issue, this script fixes it. It marks all targets in the project as migrated. For any targets that haven’t actually been migrated to Swift 2.3/3, the script outputs a one-liner that you can cut-and-paste to undo individual targets.
#!/bin/bash
PROJ=$1
if [[ -z "$PROJ" ]]; then
echo "Please provide a path to an Xcode project file."
exit 1
fi
ROOT=$(/usr/libexec/PlistBuddy -c "Print rootObject" $PROJ)
@rjonesy
rjonesy / NewMacSetupRoutine.txt
Last active September 5, 2016 21:14
Ryan Jones New Mac Setup Routine
Ryan Jones | @rjonesy | 08-18-2016
All numbered lines are instructions. All non-number indented lines are code in Terminal.app (remove "$" when pasting in Terminal.app).
# PART 1
1. Make library folder visible again:
$ chflags nohidden ~/Library/
2. Disable local time machine:
$ sudo tmutil disablelocal
@tolpp
tolpp / xcode8-swift2.3-cocapods.podfile.rb
Created July 14, 2016 14:35
CocoaPods Podfile post_install script for adding swift_version property to targets or pod_project. You can use this post_install script if you are working with pods that not compatible with Swift 3.0.
# set true if all pods in the pod_project needs to be flaggged as swift 2.3
legacy_swift_pods_project = true
# Array for pods that will be flagged as swift version 2.3
# if legacy_swift_pods_project is true, you don't need to add any item in array.
legacy_swift_pods = ['Alamofire']
post_install do |installer|
if legacy_swift_pods_project
installer.pods_project.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
@keith
keith / link.sh
Last active December 22, 2016 13:35
Build to iOS 10 from Xcode 7.3.1