Skip to content

Instantly share code, notes, and snippets.

@tarrouye
tarrouye / Scratchpad.swift
Last active March 15, 2025 08:10
Apple Music Profile Effect
import SwiftUI
struct AppleMusicProfile: View {
let profileImage: Image
let name: String
let username: String
var body: some View {
ZStack {
// (1) Blurred profile image for background
@dankamel
dankamel / BottomSheetDesign.swift
Last active March 27, 2025 03:25
Native iOS 15 Adjustable Bottom Sheet In SwiftUI (half bottom sheet)
import SwiftUI
struct BottomSheetDesign: View {
@State var showSheet: Bool? = nil
var body: some View {
Button(action: { showSheet = true }) {
@mbierman
mbierman / updatedocker.sh
Last active December 24, 2024 22:49
Update Docker containers on Fireawlla
#!/bin/bash
# version 3.2.0
# https://gist.github.com/mbierman/6cf22430ca0c2ddb699ac8780ef281ef
wait=1
container=$1
DOCKER=$(which docker)
# Check if Docker is installed
@joemasilotti
joemasilotti / Multiple sheets in SwiftUI.md
Last active October 13, 2021 03:20
Multiple sheets in SwiftUI
import UIKit
import SceneKit
import ARKit
class ViewController: UIViewController, ARSCNViewDelegate {
@IBOutlet var sceneView: ARSCNView!
var anchorCount = 0
guard let query = arView.makeRaycastQuery(from: arView.center, allowing: .existingPlaneInfinite, alignment: .horizontal) else { return }
guard let raycastResult = arView.session.raycast(query).first else { return }
// set a transform to an existing entity
let transform = Transform(matrix: raycastResult.worldTransform)
entity.transform = transform
// or anchor an entity to an ARRaycastResult
let anchor = AnchorEntity(raycastResult: raycastResult)
anchor.addChild(entity)
@toddway
toddway / aChecklistForReviewingCode.md
Last active October 7, 2020 15:50
A checklist for reviewing code

A checklist for reviewing code

Integration

  • Will merging this code create source conflicts?
  • Is there a clear and concise description of the changes?
  • Did all automated checks (build, test, lint) run and pass?
  • Are there supporting metrics or reports (e.g. test coverage, fitness functions) that measure the impact?
  • Are there obvious logic errors or incorrect behaviors that might break the software?

Readability

@sahara-ooga
sahara-ooga / HaveXcode9RenderMarkdown.md
Created November 26, 2017 09:18
Have Xcode 9 render markdown

Have Xcode 9 render markdown

To make Xcode 9 render markdown file eg. README.md, drop .xcodesamplecode.plist in your .xcodeproj/ folder. .xcodesamplecode.plist is like this:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array/> </plist>

For convenience, There is this tool, which is derived from a tutorial.

@mort3za
mort3za / git-auto-sign-commits.sh
Last active February 5, 2025 18:58
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@manasthakur
manasthakur / plugins.md
Last active January 17, 2025 13:17
Managing plugins in Vim

Managing plugins in Vim: The basics

Let's say the plugin is at a GitHub URL https://github.com/manasthakur/foo. First get the plugin by either cloning it (git clone https://github.com/manasthakur.foo.git) or simply downloading it as a zip (from its GitHub page).

Adding a plugin in Vim is equivalent to adding the plugin's code properly into its runtimepath (includes the $HOME/.vim directory by default). For example, if the layout of a plugin foo is as follows:

foo/autoload/foo.vim
foo/plugin/foo.vim