I hereby claim:
- I am czechboy0 on github.
- I am honzadvorsky (https://keybase.io/honzadvorsky) on keybase.
- I have a public key ASDrO2xgsCJ5xuHgLnr4TfUqgexRE33AOzRyvLE080gOWwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env bash | |
# Automatically installs swiftenv and run's swiftenv install. | |
# This script was designed for usage in CI systems. | |
git clone --depth 1 https://github.com/kylef/swiftenv.git ~/.swiftenv | |
export SWIFTENV_ROOT="$HOME/.swiftenv" | |
export PATH="$SWIFTENV_ROOT/bin:$SWIFTENV_ROOT/shims:$PATH" | |
if [ -f ".swift-version" ] || [ -n "$SWIFT_VERSION" ]; then | |
swiftenv install -s |
# you find the app id of an app by calling the following API and parse the JSON | |
QUERY="swiftkey" | |
curl -X "GET" "https://itunes.apple.com/search?term=$QUERY&country=us&entity=software" | |
# this is how you fetch the page 3 of the app with ID 911813648 (SwiftKey) | |
# you'd probably want to write a script and start fetching from page 1 up until you get 404 back | |
PAGE=3 | |
APPID=911813648 | |
curl -X "GET" "https://itunes.apple.com/us/rss/customerreviews/page=$PAGE/id=$APPID/sortby=mostrecent/json?urlDesc=%2Fcustomerreviews%2Fid%3D$APPID%2FsortBy%3DmostRecent%2Fjson" |
# based on https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 | |
# run with eval "$(curl -sL https://gist.githubusercontent.com/czechboy0/ba249dc375dd6335f30f7acd593aa193/raw/add_swap.sh)" | |
echo "Starting with swap table:" | |
sudo swapon -s | |
echo "Available space:" | |
df -h | |
echo "Creating a 4GB swap file" |
import Foundation | |
extension Collection where Iterator.Element == (key: String, value: FileWrapper) { | |
func hello() -> String { | |
return "world" | |
} | |
} | |
let dict: [String: FileWrapper] = [:] | |
print(dict.hello()) |
0 = Success | |
1 = Operation not permitted | |
2 = No such file or directory | |
3 = No such process | |
4 = Interrupted system call | |
5 = Input/output error | |
6 = No such device or address | |
7 = Argument list too long | |
8 = Exec format error |
#!/bin/bash | |
# | |
# Faster toolchain build: skips as much as possible. | |
# | |
# To use this toolchain from the command line:" | |
# export TOOLCHAINS=$(whoami) | |
# | |
# we build to the same prefix every time (instead of building | |
# to a versioned prefix) because every time the prefix changes | |
# *everything* rebuilds. |
For the sake of a vibrant Swift community, we need to call things what they are. And what they aren't.
I recently wrote a JSON parser to accomodate for the lack of NSJSONSerialization on Linux. When searching for an existing one, I was caught by all these libraries which called themselves JSON parsers, but were in fact just wrapping calls to an actual underlying parser (usually NSJSONSerialization). They only provided convenience functions for unwrap values from dictionaries and mapping data to objects.
Those libraries are JSON-to-object mapping libraries. Those are JSON convenience function libraries.
#!/bin/bash | |
# Installs the latest stable Redis version in a local directory | |
if [ -d ~/.redis-stable ]; then | |
echo "redis is already installed, ignoring..." | |
else | |
echo "Installing the latest Redis stable from source" | |
curl -O http://download.redis.io/redis-stable.tar.gz > /dev/null 2>&1 |
229.9ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/AES.swift:215:18 private final func decryptBlock(block: [UInt8]) -> [UInt8]? | |
206.1ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/AES.swift:297:18 private final func expandKeyInv(key: [UInt8], variant: AESVariant) -> [[UInt32]] | |
124.6ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/SHA2.swift:116:10 final func calculate32() -> [UInt8] | |
115.3ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/SHA1.swift:19:10 final func calculate() -> [UInt8] | |
77.4ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/ChaCha20.swift:49:24 private final func wordToByte(input: [UInt32]) -> [UInt8]? | |
76.9ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/SHA2.swift:198:10 final func calculate64() -> [UInt8] | |
75.7ms /Users/honzadvorsky/Documents/CryptoSwift/Sources/CryptoSwift/Poly1305.swift:263:18 private final func blocks(context: Context, m: [UInt8], startPos: Int = default) -> Int | |
72.6ms /Users |