Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
user_id=`id -u`
if [ $user_id -ne 0 ]; then
echo "Need to run with sudo privilege"
exit 1
fi
# Determine OS type
void main() {
var service = Service();
service.data.get(or: 99);
}
class Service<T> {
final Loading<T> data;
Service({this.data = Loading.loading});
}
@nishtahir
nishtahir / main.dart
Last active February 8, 2020 01:47
The Dart type system is weird
void main() {
List<String> test = ["hello"];
print("expected: true, actual : ${test is List<String>}");
print("expected: false, actual : ${test is List<int>}");
print("expected: false, actual : ${test is List<void>}");
print("expected: true, actual : ${test is List<dynamic>}");
print("Welcome to the void...");
}
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val button = findViewById(R.id.button)
val editText = findViewById(R.id.editText) as EditText
button.setOnClickListener {