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
{ | |
"keys": [ | |
{ | |
"kty":"RSA", | |
"use": "sig", | |
"kid":"2QQqDBfKJn2OwmllGzfuW8B8rJG2zaDUP8vNCAprJ18", | |
"e":"AQAB", | |
"n":"r_rk7ISYQgq6TuDJSxWspm3eJQNiMjRu82F7HDm89B9TNnUvdHfCz5mJbrIUo_u4K0p1bFVrpjjZiBFTfWAduWchDkw9Eseq8_oZ7xANiFwRSuXgUfGpyk7WmaN0E3tcKN1gLTJQAa0MqtwqcuErLpNjoLLau2CAHeHe3e_lhHZIG6LLf7e_zchkosUFP0M5ntgg84w0AZS3kleqrqduC7l4giWRjI3LAuO3lba7LqCnJ3xUc4eDeQ6ZfRJIgDO8iKr8c2cOc1W_iRJKVCF9QyOKj24L23Sio6gFH6mz_OAKyn8Guzkli9eqz29eRaz_1lwmEe6KlgRMm0cS8VvHZQ" | |
} | |
] |
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
const customFontBase64 = | |
'data:application/font-woff;base64,d09GRgABAAAAADw8ABMAAAAAa2QAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAcYBTwP0dERUYAAAHEAAAAHQAAACAAsgAER1BPUwAAAeQAAAanAAAYaBdRN2dHU1VCAAAIjAAAASkAAANY3c7wUk9TLzIAAAm4AAAAVQAAAGB+wKqtY21hcAAAChAAAAEfAAAB2oRz5lljdnQgAAALMAAAACAAAAAgBHIGdGZwZ20AAAtQAAABsQAAAmVTtC+nZ2FzcAAADQQAAAAIAAAACAAAABBnbHlmAAANDAAAKPEAAEAMpZJ0TmhlYWQAADYAAAAAMwAAADYAXuHraGhlYQAANjQAAAAdAAAAJAbbA4hobXR4AAA2VAAAAZMAAAIUEaoZw2xvY2EAADfoAAAA+wAAAQyICJmcbWF4cAAAOOQAAAAgAAAAIAGiAYhuYW1lAAA5BAAAAYYAAANMLhR19XBvc3QAADqMAAABMwAAAduaqhDkcHJlcAAAO8AAAABzAAAAhuz9vaB3ZWJmAAA8NAAAAAYAAAAGnrVSwQAAAAEAAAAAzD2izwAAAADE7/48AAAAAM7nTzN42mNgZGBg4ANiCQYQYGJgBMIWIGYB8xgACfYAtwAAAHjazVhbbJRFFP7+f9kCvS30QqHQcttyxwBelnKLD8QIChoBFVCCD/Ki8YH4QNQH44MPxEcffETiA0jESMBgVEygSglaQKUUECjlXmBb293tXnP8Zv6/293ubtlufxJ38s8//5mZM+d8c86ZswMDQDHqsQDGu2+9/x7GYBQpEIHqMd55e6eiwfpin8m3iWLXdhgu6LFz8QZ24DMcxGEcQzNa0IYOPEDIGGWUGxONJ4zVxlpjo7HF+NjYbXxufG38ZLQYYbPc9JpL+H7R3GHuMj8xvzAPmk1mi3nTDHGFRpRiHcayVMq/qJFz |
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
var a = { n: 1} | |
a.x = a; | |
console.log(a, a.x); | |
// {n:1, x: { ... }, {n:1, x: { ... }} | |
var b = { n: 1} | |
b.x = b = { n:2}; | |
console.log(b, b.x); |
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
void main() { | |
print(' '.padLeft(10,'-') + 'Exception Handling' + ' '.padRight(10,'-')); | |
// Error Catching | |
try { | |
CalculatePerformanceByTaskCompleted(-50); | |
} catch(e) { | |
print(e); | |
} | |
} |
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
void main() { | |
print(' '.padLeft(10,'-') + 'Function as Parameter' + ' '.padRight(10,'-')); | |
Person newUser = Person(talk: trashTalk); | |
newUser.talk(); // Try dunk it! | |
newUser.talk = friendlyTalk; | |
newUser.talk(); // You can do it. |
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
void main() { | |
print(' '.padLeft(10,'-') + 'Ternary Operator' + ' '.padRight(10,'-')); | |
bool expression = true; | |
// Logic -> used in business logic of binary/simple strategy; | |
expression ? { | |
print(true) | |
} : { | |
print(false) |
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
void main() { | |
var orderType = OrderType.Domestic; | |
// ENUM item -> index | |
print(' '.padLeft(10,'-') + 'Enum index' + ' '.padRight(10,'-')); | |
print(orderType.index); | |
// ENUM item -> value | |
print(' '.padLeft(10,'-') + 'Enum value' + ' '.padRight(10,'-')); | |
print(orderType); | |
} |
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
void main() { | |
// handle data | |
// use Class is kind of overkill from Design Perspective | |
var user = { | |
'name': 'Nikk.Li', | |
'age': 28, | |
'height': 171.0, | |
'weight': 63, | |
'children': null |
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
void main() { | |
List<String> usernames = ['lana', 'del', 'rey', 'hope', 'sandoval']; | |
// add => bottom | |
usernames.add('nikk'); | |
print(usernames); //[lana, del, rey, hope, sandoval, nikk] | |
// add all | |
usernames.addAll(['wenyan', 'li']); | |
print(usernames); // [lana, del, rey, hope, sandoval, nikk, wenyan, li] |
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
void main() { | |
// ? Operator | |
Coke myCoke = Coke(volume: 600); | |
// this is unsafe as anyone can change volume before printing. | |
// for example, myCoke = null | |
// then it gonna throw an error. | |
print(myCoke.volume); // 600 | |
// so let's use ? as null check operator to ensure this won't happen |
NewerOlder