Skip to content

Instantly share code, notes, and snippets.

View VishwaiOSDev's full-sized avatar
:octocat:
🌐 Hello, World!

Vishweshwaran Ravi VishwaiOSDev

:octocat:
🌐 Hello, World!
View GitHub Profile
@VishwaiOSDev
VishwaiOSDev / vapor-test.yml
Created February 18, 2023 15:11
This GitHub Actions workflow is designed to build and test a Swift project when a pull request is opened or updated on the main branch.
name: test
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Swift
uses: slashmo/install-swift@v0.4.0
@VishwaiOSDev
VishwaiOSDev / vapor-deploy.yml
Created February 18, 2023 15:09
This is a GitHub Actions workflow called "Deploy" that automatically deploys a Swift Vapor API to a remote server whenever code is pushed to the main branch (ignoring changes to markdown files).
name: Deploy
on:
push:
branches:
- main
paths-ignore:
- '**.md'
env:
@VishwaiOSDev
VishwaiOSDev / Task+Extension.swift
Last active June 3, 2022 12:27
If one wants to use Task.sleep it needs nanoseconds for sleep parameter. This extension will convert the seconds to nanoseconds. We can use sleep with seconds function instead of nanoseconds.
extension Task where Success == Never, Failure == Never {
static func sleep(seconds: TimeInterval) async throws {
let duration = UInt64(seconds * 1_000_000_000)
try await Task.sleep(nanoseconds: duration)
}
}
// Usage
try await Task.sleep(seconds: 1)
@VishwaiOSDev
VishwaiOSDev / CleanDerivedData.md
Last active May 1, 2022 07:00
Clean Xcode Derived Data from Terminal

Clean Derived Data

There is a handy way to clean Xcode Derived Data using Terminal. Please follow the below steps carefully.

Steps

  1. Check does your mac have .zshrc file.
  2. Open terminal type cd ~ this will switch your terminal to root directory.
  3. Now type ls -al this command will show list of all files in that directory including the hidden files.
  4. Check .zshrc file is available.
  5. If you have .zshrc file go to Step 7.
  6. If you don't have .zshrc file type touch .zshrc this will create a new .zshrc file.
  7. Now paste this command echo "alias blast='rm -rf ~/Library/Developer/Xcode/DerivedData'" >> .zshrc