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 Foundation | |
public actor TaskQueue { | |
private let maxConcurrentTasks: Int | |
private var runningTasks = 0 | |
private var queue: [CheckedContinuation<Void, Never>] = [] | |
public init(maxConcurrentTasks: Int) { | |
self.maxConcurrentTasks = maxConcurrentTasks | |
} |
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
#!/bin/bash | |
#Setup the environment | |
mkdir tmp_download | |
cd tmp_download | |
#Extract IDs | |
echo "Downloading the index" | |
wget -q https://developer.apple.com/videos/wwdc2022/ -O index.html | |
cat index.html | sed -n '/data-released=\"true\"/,/class=\"video-image-link\"/p' | grep videos/play/wwdc2022 | sed -e 's/.*wwdc2022\///' -e 's/\/\"\ .*//' | sed '$!N; /^\(.*\)\n\1$/!P; D' > ../downloadData |
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
#!/bin/bash | |
#Setup the environment | |
mkdir tmp_download | |
cd tmp_download | |
#Extract IDs | |
echo "Downloading the index" | |
wget -q https://developer.apple.com/videos/wwdc2020/ -O index.html | |
# find parts of the document where data-released=true, all the way to the first H4 header where title of that talk is |
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
#!/bin/bash | |
#Setup the environment | |
mkdir tmp_download | |
cd tmp_download | |
#Extract IDs | |
echo "Downloading the index" | |
wget -q https://developer.apple.com/videos/wwdc2019/ -O index.html | |
# find parts of the document where data-released=true, all the way to the first H4 header where title of that talk is |
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
public extension Dictionary { | |
func mapKeys<T>(_ transform: (Key) throws -> T) rethrows -> [T : Value] where T: Hashable { | |
var dict: [T: Value] = [:] | |
for (key, value) in self { | |
let newKey = try transform(key) | |
dict[newKey] = value | |
} | |
return dict | |
} | |
} |
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
#!/bin/bash | |
#Setup the environnement | |
mkdir wwdc2018 | |
cd wwdc2018 | |
mkdir tmp_download | |
cd tmp_download | |
#Extract IDs | |
echo "Downloading the index" |
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
let expandedSections = [0, 3, 8] | |
let indexSet = IndexSet(expandedSections) | |
collectionView?.performBatchUpdates( | |
{ | |
[unowned self] in | |
if isInserted { | |
self.collectionView?.insertItems(at: indexPaths) | |
} else { | |
self.collectionView?.deleteItems(at: indexPaths) |
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
#!/bin/sh | |
# Current as working as of 2012/4/17 | |
# Xcode 4.3.2 | |
PROJECT_ROOT="$HOME/SomeDirWhereYourProjectLives/XXXXXXXX" | |
WORKSPACE="$PROJECT_ROOT/XXXXXXXX.xcodeproj/project.xcworkspace" | |
CONFIG="AdHoc" | |
SCHEME="XXXXXXXX" |
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
(lldb) po ticketManager.isBuildingTicket | |
error: warning: <EXPR>:12:9: warning: initialization of variable '$__lldb_error_result' was never used; consider replacing with assignment to '_' or removing it | |
var $__lldb_error_result = __lldb_tmp_error | |
~~~~^~~~~~~~~~~~~~~~~~~~ | |
_ | |
error: <EXPR>:18:5: error: value of type 'TicketController' has no member '$__lldb_wrapped_expr_0' | |
$__lldb_injected_self.$__lldb_wrapped_expr_0( | |
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ |
NewerOlder