Skip to content

Instantly share code, notes, and snippets.


Eugen Pirogoff eugenpirogoff

View GitHub Profile
ole / DateFormatting.swift
Created Jun 18, 2021
ISO8601 date formatting in Foundation in iOS 15/macOS 12
View DateFormatting.swift
import Foundation
let date =
date.formatted(.iso8601) // "20210618T191800Z"
date.formatted(.iso8601.year().month().day().dateSeparator(.dash)) // "2021-06-18"
date.formatted(.iso8601.dateSeparator(.dash).timeSeparator(.colon)) // "2021-06-18T19:18:00Z"
View UIHostingController-Keyboard.swift
extension UIHostingController {
convenience public init(rootView: Content, ignoreSafeArea: Bool) {
self.init(rootView: rootView)
if ignoreSafeArea {
func disableSafeArea() {
SwitHak /
Last active May 24, 2021
BlueTeam CheatSheet * CVE-2020-0601 * crypt32.dll | Last updated: 2020-01-21 1817 UTC

CVE-2020-0601 AKA ChainOfFools OR CurveBall


  • Microsoft disclosed a vulnerability in their monthly Patch Tuesday referenced under CVE-2020-0601.
  • The vulnerability was discovered by the U.S. National Security Agency, anounced today (2020-01-14) in their press conference, followed by a blog post and an official security advisory.
  • The flaw is located in the "CRYPT32.DLL" file under the C:\Windows\System32\ directory.

Vulnerability explanation

  • NSA description:
  • NSA has discovered a critical vulnerability (CVE-2020-0601) affecting Microsoft Windows® cryptographic functionality.
saelo /
Last active Jan 15, 2021
Writeup for the "Dezhou Instrumentz" challenge from the Real World CTF Qualifier 2019

Dezhou Instrumentz

The challenge consisted of an iOS app ( which implemented a simple calculator. Moreover, the app also registered a custom URL scheme (icalc://) which would simply evaluate the content of the URL. The calculator was implemented using NSExpressions and the input string would simply be parsed as such an expression and executed. NSExpressions are pretty powerful and allow for example calls to ObjC Methods (e.q. typing in sqrt(42) would end up calling +[_NSPredicateUtilities sqrt:@42]). Further, there are two interesting helper functions available in NSExpressions:

FUNCTION(obj, 'foo', "bar")

Which will result in a call of the method 'foo' on object obj with parameter "bar" (an NSString).

standinga / Swift Playground Audio playing audio files with AVAudioPlayerNode on top of AVPlayer or on top of another AVAudioPlayerNode.swift
Last active Mar 15, 2022
Swift Playground Audio playing audio files with AVAudioPlayerNode on top of AVPlayer or on top of another AVAudioPlayerNode
View Swift Playground Audio playing audio files with AVAudioPlayerNode on top of AVPlayer or on top of another AVAudioPlayerNode.swift
import AVFoundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class AudioPlayer {
var topAudioFiles: [AVAudioFile] = []
var engine:AVAudioEngine
var backgroundAudioNode: AVAudioPlayerNode
var backgroundAudioFile: AVAudioFile
standinga / AudioPlayground.swift
Last active Sep 11, 2022
Swift Playground shows how to play multiple wav files on top of background audio file, using AVAudioPlayerNode, AVAudioMixerNode, AVAudioEngine
View AudioPlayground.swift
import AVFoundation
import UIKit
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
class AudioPlayer {
var backgroundAudioFile:AVAudioFile
var topAudioFiles: [AVAudioFile] = []
fs0c131y / get_sqlcipher_password.js
Created Jan 27, 2019
Frida script to get the password of a sqlcipher database
View get_sqlcipher_password.js
* get_sqlcipher_password.js
* Copyright (c) 2019 Elliot Alderson <>
* JS functions to get SQLCipher database passwords.
* Example usage:
* # frida -U -f -l get_sqlcipher_password.js --no-pause
DerekSelander / dsresign
Last active May 28, 2022
Resign iOS .app directories, expects app dir, provisioning profile, [optional] new name for iOS app
View dsresign
# MIT License
# Copyright (c) 2018 Derek Selander (@LOLgrep)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
shaps80 / Scheduling-AppDelegate.swift
Last active Feb 16, 2022
NSNotification Scheduling Service in Swift. (the only required file is `SchedulingService.swift`)
View Scheduling-AppDelegate.swift
// AppDelegate.swift
// Scheduling
// Created by Shaps Benkau on 19/02/2018.
// Copyright © 2018 152percent Ltd. All rights reserved.
import UIKit
milseman /
Created Jan 10, 2018
State of String: ABI, Performance, Ergonomics, and You!

State of String: ABI, Performance, Ergonomics, and You!

Hello, I’ve been working on implementing, optimizing, and improving String in preparation for ABI stability, and I thought I’d share the current status of String in Swift 5 and some potential directions to go. This is the product of conversations with open source contributors and my colleagues on the Swift standard library team at Apple.

The primary area of focus is stabilizing String’s ABI, but we’d be remiss if we couldn’t also fit in performance and ergonomic improvements. String’s ergonomics in particular is one area where we think the status quo is woefully inadequate, and over half of this email is devoted to that topic. At the end, there’s a section about a community initiative that we hope can help users of String as well as guide future development.

(Note: I’m sending this to swift-dev because much of the contents revolve around implementation concerns. I’ll also cross-reference on swift-evolution and swift-users. See also the [StringManife