Skip to content

Instantly share code, notes, and snippets.

View jasesuperhero's full-sized avatar
🤘
Let's rock

Daniel Kalintsev jasesuperhero

🤘
Let's rock
View GitHub Profile
@ole
ole / UserDefaultsAsyncSequence.swift
Last active January 23, 2024 18:03
UserDefaults KVO observation with AsyncSequence/AsyncStream
// UserDefaults KVO observation with AsyncSequence/AsyncStream
// Ole Begemann, 2023-04
// https://gist.github.com/ole/fc5c1f4c763d28d9ba70940512e81916
import Foundation
extension UserDefaults {
func observeKey<Value>(_ key: String, valueType _: Value.Type) -> AsyncStream<Value?> {
var continuation: AsyncStream<Value?>.Continuation? = nil
let stream = AsyncStream(Value?.self) {
@stupergenius
stupergenius / pre-commit hook for Swiftlint
Last active March 26, 2019 20:48 — forked from candostdagdeviren/pre-commit
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
if [ "$SKIP_SWIFTLINT" = "true" ]; then
exit 0
fi
if which swiftlint >/dev/null; then
if [ "$1" = "buildphase" ]; then
swiftlint lint
elif [ "$1" = "postcommit" ]; then
@dinobei
dinobei / KKSimplePlayer.swift
Created June 8, 2018 06:52 — forked from zonble/KKSimplePlayer.swift
Using AudioQueue and Swift to do a simple stream player
import Foundation
import AudioToolbox
class KKSimplePlayer: NSObject {
var URL: NSURL
var URLSession: NSURLSession!
var packets = [NSData]()
var audioFileStreamID: AudioFileStreamID = nil
var outputQueue: AudioQueueRef = nil
var streamDescription: AudioStreamBasicDescription?
@trandaison
trandaison / starUML.md
Last active July 22, 2024 16:02
Get full version of StarUML
@levantAJ
levantAJ / AssetRecorderView.swift
Last active April 8, 2021 06:31
Record video, with auto detect faces, and overlay mask into faces
//
// AssetRecorderView.swift
// Snowball
//
// Created by Le Tai on 7/20/16.
// Copyright © 2016 Snowball. All rights reserved.
//
import UIKit
import AVFoundation
@candostdagdeviren
candostdagdeviren / pre-commit
Last active April 22, 2023 09:32
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
//
// MyMetalWaterfall.swift
// version 0.1.105 (updated for Swift 5)
//
// Demonstrates using a MetalKit compute shader to render a live waterfall RGB bitmap
// into a UIView
//
// This is a single file iOS app
//
// It includes AppDelegate for a minimal demonstration app
@hotpaw2
hotpaw2 / RecordAudio.swift
Last active April 3, 2024 03:10
Swift Audio Recording class. Reads buffers of input samples from the microphone using the iOS RemoteIO Audio Unit API
//
// RecordAudio.swift
//
// This is a Swift class (updated for Swift 5)
// that uses the iOS RemoteIO Audio Unit
// to record audio input samples,
// (should be instantiated as a singleton object.)
//
// Created by Ronald Nicholson on 10/21/16.
// Copyright © 2017,2019 HotPaw Productions. All rights reserved.
@teknologika
teknologika / A Dashing test results widget.md
Last active September 26, 2018 01:44
A Testing Status widget for dashing

Description

A Dashing widget to display the number of passing, ignored and failing tests from a test result file in the JUnit XML format.

Dependencies

The following dependencies are required. Please add them to your dashing gemfile.

gem 'nokogiri'
@dragonai
dragonai / README.md
Last active July 15, 2019 18:48
GitHub Organization Open Pull Requests

##Preview

Description

Simple Dashing widget that displays all currently open pull requests across a GitHub organization.

##Usage