Skip to content

Instantly share code, notes, and snippets.


Michel Storms stormychel

View GitHub Profile
View removeSpecialCharacters.swift
import Foundation
extension String {
var withoutPunctuations: String {
return self.components(separatedBy: CharacterSet.punctuationCharacters).joined(separator: "")
let originalStr:String = "hello, (Nice to- meet 한국 école %&$you all. 123 ! Давай العربية 😀"
EnesKaraosman / RandomColor.swift
Last active Jul 11, 2021
Generatin random color in SwiftUI & UIKit
View RandomColor.swift
#if canImport(UIKit)
import UIKit
extension UIColor {
static var random: UIColor {
return UIColor(
red: .random(in: 0...1),
green: .random(in: 0...1),
blue: .random(in: 0...1)
MaciejGad / NSImageExtensions.swift
Created Mar 24, 2017
NSImage extensions for easy resizing, cropping and saving png images. Version updated for Swift 3. Originally by Raphael Hanneken
View NSImageExtensions.swift
extension NSImage {
/// Returns the height of the current image.
var height: CGFloat {
return self.size.height
/// Returns the width of the current image.
var width: CGFloat {
return self.size.width
keithweaver /
Created Mar 10, 2017
Create a folder with Python
import os
def createFolder(directory):
if not os.path.exists(directory):
except OSError:
print ('Error: Creating directory. ' + directory)