Skip to content

Instantly share code, notes, and snippets.

View marcioadr88's full-sized avatar

Marcio Duarte marcioadr88

View GitHub Profile
@marcioadr88
marcioadr88 / size_compare.sh
Created October 28, 2021 15:26
Compare compressed and uncompressed requests using cURL
#!/usr/bin/env bash
set -e
compare() {
echo "URI: ${1}"
SIZE=$(curl -so /dev/null "${1}" -w '%{size_download}')
echo "Uncompressed size : $SIZE bytes"
# compressed add the header Accept-Encoding: deflate, gzip, br, zstd
@marcioadr88
marcioadr88 / AppDelegate.swift
Created July 5, 2018 19:18
Background fetch with Mailcore 2
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let settings = UIUserNotificationSettings(types: UIUserNotificationType.alert, categories: nil)
UIApplication.shared.registerUserNotificationSettings(settings)
UIApplication.shared.setMinimumBackgroundFetchInterval(UIApplicationBackgroundFetchIntervalMinimum)
return true
}