-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xcode-build-bump.sh | |
# @desc Auto-increment the build number every time the project is run. | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" | |
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
/** | |
Truncates the string to the specified length number of characters and appends an optional trailing string if longer. | |
- Parameter length: A `String`. | |
- Parameter trailing: A `String` that will be appended after the truncation. | |
- Returns: A `String` object. | |
*/ | |
func truncate(length: Int, trailing: String = "…") -> String { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIImageView { | |
/// Loads image from web asynchronosly and caches it, in case you have to load url | |
/// again, it will be loaded from cache if available | |
func load(url: URL, placeholder: UIImage?, cache: URLCache? = nil) { | |
let cache = cache ?? URLCache.shared | |
let request = URLRequest(url: url) | |
if let data = cache.cachedResponse(for: request)?.data, let image = UIImage(data: data) { | |
self.image = image | |
} else { | |
self.image = placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// credit to @eirnym, adapted this from their OBJC code: https://gist.github.com/eirnym/c9526a045556e4d8464b41a367843e3c | |
// generates a random date and time in the past, limited by daysBack (a number of days before today) | |
// also generates a random time to go with that date. | |
// original request: http://stackoverflow.com/questions/10092468/how-do-you-generate-a-random-date-in-objective-c | |
func generateRandomDate(daysBack: Int)-> Date?{ | |
let day = arc4random_uniform(UInt32(daysBack))+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No Security | |
{ | |
"rules": { | |
".read": true, | |
".write": true | |
} | |
} |
You are going to create a very simple rock paper scissors game. It will consist of three buttons, one for each of the moves you can play. Tap on one of these buttons to chose your move, then the iPhone will randomly choose a move and a you either win, lose, or 👔.
Rules of Rock Paper Scissors:
- Each sign can beat one (and only one) other:
- Rock smashes scissors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env swift | |
// | |
// faceExtraction.swift | |
// FaceITDetection | |
// | |
// Extracts faces detected in images | |
// | |
// Created by NovaTec GmbH on 16.08.17. | |
// Copyright © 2017 NovaTec GmbH. All rights reserved. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PlaygroundSupport | |
extension Double { | |
func toRadians() -> Double { | |
return self * Double.pi / 180 | |
} | |
func toCGFloat() -> CGFloat { | |
return CGFloat(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gist file for Creating Activity Rings in SwiftUI | |
// https://swdevnotes.com/swift/2021/create-activity-rings-in-swiftui/ | |
// | |
// All code in one ContentView.swift file just for sharing | |
// | |
// Created by Eric on 05/09/2021. | |
// | |
import SwiftUI |
OlderNewer