Skip to content

Instantly share code, notes, and snippets.

@truizlop
truizlop / Wave.swift
Created September 10, 2020 14:41
Wave animation using SwiftUI
import SwiftUI
let LINE_LENGTH: Double = 500.0
let N = 720
let LINES = 18
let WAVES: Double = 18.0
let WAVE_HEIGHT: Double = 20
let SPACING: Double = 27.0
let CURL_AMOUNT: Double = 12.0
@pldmgg
pldmgg / UnRaid_HassOS_VM_Setup
Last active May 21, 2020 13:57
UnRaid_HassOS_VM_Setup
##### What You'll Need (assuming your workstation is Windows) #####
- Qemu For Windows: https://qemu.weilnetz.de/w64/
- WinSCP: https://winscp.net/eng/download.php
- 7zip: https://www.7-zip.org/download.html
- The VMDK virtual disk from the Home Assistant website: https://www.home-assistant.io/hassio/installation/
- Access to your UnRaid WebGUI from your Windows workstation
#### Installing Qemu On Your Windows Workstation ####
- Why? Because the virtual disk images provided by the Home Assistant website are not in a format that UnRaid can understand.
@heartnn
heartnn / another_way.md
Last active March 6, 2024 13:24
How to properly do a filesystem check (fsck or e2fck) on Synology DSM 6.0 e.g. DS414

syno_poweroff_task -d

umount /volume1 (replace this with your volume name)

fsck.ext4 -pvf /dev/md0 (replace this with your dev)

reboot the system after the scan is completed


via:

@chockenberry
chockenberry / Debug.swift
Last active April 11, 2024 13:22
Debug and release logging in Swift that's reminiscent of NSLog()
//
// Debug.swift
//
// Created by Craig Hockenberry on 3/15/17.
// Updated by Craig Hockenberry on 2/20/24.
// Usage:
//
// SplineReticulationManager.swift:
//
@marslin1220
marslin1220 / RequestPlayground.swift
Last active August 28, 2023 02:33
How to create a HTTP GET request on Swift Playground
import Foundation
import PlaygroundSupport
URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil)
PlaygroundPage.current.needsIndefiniteExecution = true
// Refer to the example: https://grokswift.com/simple-rest-with-swift/
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todo/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")