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
<?php | |
$verbose = fopen('php://temp', 'rw+'); | |
$options = array( | |
CURLOPT_RETURNTRANSFER => 1, // 不直接印出結果 | |
CURLOPT_URL => $target_url, | |
CURLOPT_POST => true, | |
CURLOPT_POSTFIELDS => $query_string, //$data, // 直接給array | |
CURLOPT_VERBOSE => true, | |
CURLOPT_STDERR => $verbose |
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
require 'rails_helper' | |
describe 'The integer should be i' do | |
i = 1 | |
it 'should be 1' do | |
expect(i).to be 1 | |
end | |
it 'should be 2' do | |
expect(i).not_to be 2 |
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
#if DEBUG | |
print(true) | |
#else | |
print(false) | |
#endif |
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
for family: String in UIFont.familyNames { | |
print("\(family)") | |
for names: String in UIFont.fontNames(forFamilyName: family) { | |
print("== \(names)") | |
} | |
} |
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
class BackgroundTask { | |
private let application: UIApplication | |
private var identifier = UIBackgroundTaskInvalid | |
init(application: UIApplication) { | |
self.application = application | |
} | |
class func run(application: UIApplication, handler: (BackgroundTask) -> ()) { | |
// NOTE: The handler must call end() when it is done |