This file contains hidden or 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
#!/bin/bash | |
# https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api | |
searchTerms=( | |
# File timestamp APIs | |
"creationDate" | |
"modificationDate" | |
"fileModificationDate" | |
"contentModificationDateKey" | |
"creationDateKey" |
This file contains hidden or 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 bash | |
# Author: @11808s8 - Adriano | |
# Email: [email protected] | |
# Version: 1.1.0 - 07/04/2020 | |
# | |
# @TODO: Refactor this, breaking parts into modules | |
# and include more comments/User feedbacks | |
# | |
# @TODO: Remove hardcoded credentials |
This file contains hidden or 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
// for multiple requests | |
let isRefreshing = false; | |
let failedQueue = []; | |
const processQueue = (error, token = null) => { | |
failedQueue.forEach(prom => { | |
if (error) { | |
prom.reject(error); | |
} else { | |
prom.resolve(token); |
This file contains hidden or 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 Foundation | |
go(println("in a thread")) | |
// buffered channel | |
var c = Chan(buffer:20) | |
// sending routing | |
go { | |
while(true) { |
This file contains hidden or 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
DROP TABLE IF EXISTS `carts`; | |
CREATE TABLE `carts` ( | |
`user_id` int NOT NULL, | |
`food_id` int NOT NULL, | |
`quantity` int NOT NULL, | |
`status` int NOT NULL DEFAULT '1', | |
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, | |
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
PRIMARY KEY (`user_id`,`food_id`), |
This breakpoint provides an easy way to track view controller deinitialization (deallocation) in UIKit-based applications. This can help finding memory leaks caused by retain cycles preventing view controllers from being deinitialized when dismissed or popped.
From Cédric Luthi's tweet in 2017:
Useful Xcode breakpoint. When you dismiss a controller and you don’t hear the pop sound (or see the log), you probably have a retain cycle.
This file contains hidden or 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 | |
fileprivate extension DateFormatter { | |
static var month: DateFormatter { | |
let formatter = DateFormatter() | |
formatter.dateFormat = "MMMM" | |
return formatter | |
} | |
static var monthAndYear: DateFormatter { |
This file contains hidden or 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
// The MIT License (MIT) | |
// | |
// Copyright (c) 2017 Alexander Grebenyuk (github.com/kean). | |
import Foundation | |
import RxSwift | |
import RxCocoa | |
extension ObservableType { |
This file contains hidden or 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
enum DynamicJSONProperty: Codable { | |
case int(Int) | |
case double(Double) | |
case string(String) | |
var intValue: Int? { | |
switch self { | |
case let .int(value): | |
return value |
NewerOlder