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
func compress(videoPath : String, exportVideoPath : String, renderSize : CGSize, completion : (Bool) -> ()) { | |
let videoUrl = NSURL(fileURLWithPath: videoPath) | |
if (!existsFileAtUrl(videoUrl)) { | |
completion(false) | |
return | |
} | |
let videoAssetUrl = AVURLAsset(URL: videoUrl, options: nil) | |
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
struct User { | |
var name: String | |
var username: String | |
var phoneNumber: String | |
} |
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
struct User: Codable { | |
var name: String | |
var username: String | |
var phoneNumber: String | |
} |
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
struct Device: Codable { | |
var name: String | |
var manufacturer: String | |
} | |
struct User: Codable { | |
var name: String | |
var username: String | |
var phoneNumber: String | |
var devices: [Device] |
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
func decode(data: Data) throws -> User? { | |
do { | |
let decoder = JSONDecoder() | |
let user = try decoder.decode(User.self, from: data) | |
return user | |
} catch let error { | |
print(error) | |
return nil | |
} | |
} |
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
struct Device: Codable { | |
var name: String | |
var manufacturer: String | |
} | |
struct User: Encodable { | |
var name: String | |
var username: String | |
var phoneNumber: String | |
var devices: [Device] |
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
struct Device: Codable { | |
var name: String | |
var manufacturer: String | |
} | |
struct User: Encodable { | |
var name: String | |
var username: String | |
var phoneNumber: String | |
var devices: [Device] |
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
pragma solidity ^0.4.17; | |
/** | |
* @title SafeMath | |
* @dev Math operations with safety checks that throw on error | |
*/ | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal constant returns (uint256) { | |
uint256 c = a * b; | |
assert(a == 0 || c / a == b); | |
return c; |
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
pragma solidity ^0.4.18; | |
/** | |
* @title Ownable | |
* @dev The Ownable contract has an owner address, and provides basic authorization control | |
* functions, this simplifies the implementation of "user permissions". | |
*/ | |
contract Ownable { | |
address public owner; |
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
pragma solidity ^0.4.17; | |
contract J8TTokenConfig { | |
// The J8T decimals | |
uint8 public constant TOKEN_DECIMALS = 8; | |
// The J8T decimal factor to obtain luckys | |
uint256 public constant J8T_DECIMALS_FACTOR = 10**uint256(TOKEN_DECIMALS); | |
} |
OlderNewer