-
平日の業務時間内に見つけた問題である関係で(自分ルールで)所属を入れていますが、他社サービスに対する調査や報告は業務とは一切関係のない個人の活動として行っています。
-
文責はmala個人にあります。お問い合わせなどありましたら個人宛にどうぞ。TwitterのDMや任意の文字列 @ma.la
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
// Swift enums cannot be declared with a rawValue if they have associated values | |
// like good ol' Amargasaurus has. Using String(describing: dino) on a case with | |
// associated also includes the values, but works fine on unassociated cases. | |
// Mirror(reflecting: dino) can extract the name of an associated case, but is | |
// nil for unassociated cases. Our hero ?? swoops in to save the day! | |
enum Sauropoda { | |
case Amargasaurus(things: Int64, hasOtherThing: Bool?) | |
case Antetonitrus | |
// ... |
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
#!/usr/bin/env ruby | |
print "What is the URL of your Apple Downloads resource?\nURL:" | |
url = gets.strip | |
print "What is the ADCDownloadAuth cookie token:\nADCDownloadAuth: " | |
token = gets.strip | |
command = "aria2c --header \"Host: adcdownload.apple.com\" --header \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\" --header \"Upgrade-Insecure-Requests: 1\" --header \"Cookie: ADCDownloadAuth=#{token}\" --header \"User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_1 like Mac OS X) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0 Mobile/14B72 Safari/602.1\" --header \"Accept-Language: en-us\" -x 16 -s 16 #{url} -d ~/Downloads" |
現状と大きく変わったのでいったん削除しました。
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 groovy.transform.ToString | |
class ResourceException extends Exception { | |
Object<?> object | |
ResourceException (Object<?> object) { | |
this.object = object | |
} | |
@Override String toString () { | |
return "${this.class} caused by ${object}." as String | |
} |