Skip to content

Instantly share code, notes, and snippets.

View radianttap's full-sized avatar
馃
路 路 路

Aleksandar Vaci膰 radianttap

馃
路 路 路
View GitHub Profile
@radianttap
radianttap / human.swift.motemplate
Last active November 13, 2016 14:57 — forked from JoshuaSullivan/human.swift.motemplate
Better mogenerator Swift 3 templates, using code very similar to what Xcode produces but with mogenerator goodies on the top
import Foundation
import CoreData
@objc(<$managedObjectClassName$>)
public class <$managedObjectClassName$>: <$customSuperentity$> {
// MARK: - Life cycle methods
public override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?) {
super.init(entity: entity, insertInto: context)
@radianttap
radianttap / wwdc17.sh
Created June 7, 2017 09:57
Bash script to download all HD videos + PDF slides for WWDC 2017
#!/bin/bash
#Setup the environnement
mkdir wwdc2017
cd wwdc2017
mkdir tmp_download
cd tmp_download
#Extract IDs
echo "Downloading the index"
@radianttap
radianttap / fall17.sh
Created September 18, 2017 12:27
Script to download Fall 2017 HD videos
#!/bin/bash
#Setup the environnement
mkdir fall2017
cd fall2017
mkdir tmp_download
cd tmp_download
#Extract IDs
echo "Downloading the index"
@radianttap
radianttap / TableHeaderFooterView.bgcolor
Created October 11, 2017 10:57
I would love to know the reasons for this. Must be quite a big technical debt for the hard-coded behavior since iPhone OS 2.
[TableView]
Setting the background color on UITableViewHeaderFooterView has been deprecated.
Please set a custom UIView with your desired background color to the backgroundView property instead.
(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(
^~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
@radianttap
radianttap / automatedBuildAndUploadToTestflight.sh
Created November 1, 2017 14:10 — forked from djacobs/automatedBuildAndUploadToTestflight.sh
Automated Xcode build and upload to TestFlight.
#!/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"
@radianttap
radianttap / dummy.swift
Created February 19, 2018 20:30
Why the hell this crashes in UICollectionView?
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)
@radianttap
radianttap / wwdc18.sh
Created June 5, 2018 07:51
WWDC 2018 PDF / HD video downloading script
#!/bin/bash
#Setup the environnement
mkdir wwdc2018
cd wwdc2018
mkdir tmp_download
cd tmp_download
#Extract IDs
echo "Downloading the index"
@radianttap
radianttap / Dictionary-mapKeys.swift
Created April 12, 2019 14:12
Dictionary, mapKeys (counterpart to mapValues)
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
}
}
@radianttap
radianttap / wwdc19.sh
Created June 6, 2019 11:23
Fetch all WWDC 2019 session videos and PDFs
#!/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