Skip to content

Instantly share code, notes, and snippets.

View marcusficner's full-sized avatar

Marcus Ficner marcusficner

View GitHub Profile
@marcusficner
marcusficner / Magical3DButton.swift
Created June 22, 2022 20:52
Magical 3D Button in SwiftUI
//
// ContentView.swift
// Magical3DButton
//
// Created by Marcus Ficner on 22.06.22.
//
import SwiftUI
struct ContentView: View {
@marcusficner
marcusficner / Waveform.swift
Created June 19, 2020 10:18
Draw a waveform with SwiftUI using a Path
struct ContentView: View {
@ObservedObject var audioEngine = AudioEngine()
var body: some View {
GeometryReader { geometry in
Path { path in
path.move(to: CGPoint(x: 0, y: geometry.size.height/2))
for i in 0..<Int(geometry.size.width) {
path.addLine(to: CGPoint(x: CGFloat(i), y: (geometry.size.height/2) + (self.scaleFactor * CGFloat(self.audioEngine.buffer[i]))))
}
@marcusficner
marcusficner / README.md
Created February 4, 2019 18:51
SCRIPT-8
@marcusficner
marcusficner / README.md
Created February 4, 2019 15:30
SCRIPT-8
@marcusficner
marcusficner / Xcode8.2PlaygroundIssues.log
Last active December 20, 2016 17:12
Output of CoreSimulator.log
macOS Sierra 10.2.2
Xcode 8.2 (8C38)
------
Dec 20 18:04:12 MF-MacBook-Pro CoreSimulatorService[1188] <Error>: Error Domain=NSMachErrorDomain Code=-308 "(ipc/mig) server died"
Dec 20 18:04:12 MF-MacBook-Pro CoreSimulatorService[1188] <Error>: Error while subscribing to pasteboard, Error Domain=NSMachErrorDomain Code=-308 "(ipc/mig) server died"
Dec 20 18:04:12 MF-MacBook-Pro CoreSimulatorService[1188] <Error>: Error Domain=com.apple.CoreSimulator.SimError Code=163 "Invalid device state" UserInfo={NSLocalizedDescription=Invalid device state, NSUnderlyingError=0x7fe60ac02d20 {Error Domain=NSMachErrorDomain Code=-308 "(ipc/mig) server died"}}
Dec 20 18:04:12 MF-MacBook-Pro com.apple.dt.Xcode[17022] <Error>: Error Domain=NSMachErrorDomain Code=-308 "(ipc/mig) server died"
Dec 20 18:04:12 MF-MacBook-Pro com.apple.dt.Xcode[17022] <Error>: Error while subscribing to pasteboard, Error Domain=NSMachErrorDomain Code=-308 "(ipc/mig) server died"
@marcusficner
marcusficner / compile.sh
Created March 21, 2016 08:34
Compile script for C+11 in CodeRunner
#!/bin/bash
# This is a CodeRunner compile script. Compile scripts are used to compile
# code before being run using the run command specified in CodeRunner
# preferences. This script is invoked with the following properties:
#
# Current directory: The directory of the source file being run
#
# Arguments $1-$n: User-defined compile flags
#
# Environment: $CR_FILENAME Filename of the source file being run
@marcusficner
marcusficner / CoreAnimation.swift
Created February 10, 2016 12:37
Xcode playground with live view to quickly test animations
//: Playground - noun: a place where people can play
import UIKit
import XCPlayground
let aView = UIView(frame: CGRectMake(0, 0, 200, 200))
aView.backgroundColor = UIColor.whiteColor()
let aLayer = CALayer()
aLayer.bounds = CGRectMake(0, 0, 100, 100)

Keybase proof

I hereby claim:

  • I am marcusficner on github.
  • I am mficner (https://keybase.io/mficner) on keybase.
  • I have a public key whose fingerprint is 001A F2BD FE94 554C 3201 22E0 8BF3 FD1D F7B7 7634

To claim this, I am signing this object: