Skip to content

Instantly share code, notes, and snippets.

View githubRunnerInstallDependencies.sh
#!/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
View bug.dart
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 Feb 8, 2020
The Dart type system is weird
View main.dart
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...");
}
View InstantappLauncher.java
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 {