(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// | |
// BottomSheetView.swift | |
// | |
// Created by Majid Jabrayilov | |
// Copyright © 2019 Majid Jabrayilov. All rights reserved. | |
// | |
import SwiftUI | |
fileprivate enum Constants { | |
static let radius: CGFloat = 16 |
let decoder = RPJSONDecoder() | |
do { | |
let response = try decoder.decode(BaseDataArrayResponse<T>.self, from: json) | |
completion(response.data, nil) | |
} catch let DecodingError.dataCorrupted(context) { | |
completion(nil, DecodingError.dataCorrupted(context)) | |
print("codingPath:", context.codingPath) | |
} catch let DecodingError.typeMismatch(type, context) { | |
completion(nil, DecodingError.typeMismatch(type, context)) | |
print("Type '\(type)' mismatch:", context.debugDescription) |
# The trick is to link the DeviceSupport folder from the beta to the stable version. | |
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions | |
# (A similar approach works for older versions too, just change the version number after DeviceSupport) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function dex-method-count() { | |
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
} | |
function dex-method-count-by-package() { | |
dir=$(mktemp -d -t dex) | |
baksmali $1 -o $dir | |
for pkg in `find $dir/* -type d`; do | |
smali $pkg -o $pkg/classes.dex | |
count=$(dex-method-count $pkg/classes.dex) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
import urllib2, urlparse, sys, webbrowser | |
itags = {'45': 'webm_720p', | |
'44': 'webm_480p', | |
'43': 'webm_360p', | |
'38': 'mp4_3072p', | |
'37': 'mp4_1080p', | |
'36': 'phone_mp4_240p', | |
'35': 'flv_480p', | |
'34': 'flv_360p', |
import uuid, BaseHTTPServer, select, types, clipboard, console | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
try: | |
from cStringIO import StringIO | |
except ImportError: | |
from StringIO import StringIO | |
global mobile_config_str | |
mobile_config_str = '' |
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# | |
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
# | |
# Version 2.6 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |