Skip to content

Instantly share code, notes, and snippets.

@truizlop
truizlop / Wave.swift
Created Sep 10, 2020
Wave animation using SwiftUI
View Wave.swift
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
UnRaid_HassOS_VM_Setup
View 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 Jun 10, 2021
How to properly do a filesystem check (fsck or e2fck) on Synology DSM 6.0 e.g. DS414
View another_way.md

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: https://www.youtube.com/watch?v=y8LQMWYowDg

@chockenberry
chockenberry / Debug.swift
Last active Jul 20, 2021
Debug and release logging in Swift that's reminiscent of NSLog()
View Debug.swift
//
// Debug.swift
//
// Created by Craig Hockenberry on 3/15/17.
// Usage:
//
// SplineReticulationManager.swift:
//
@marslin1220
marslin1220 / RequestPlayground.swift
Last active Jun 8, 2021
How to create a HTTP GET request on Swift Playground
View RequestPlayground.swift
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")