Make a script like this:
#!/bin/bash
sh -c "$1 $2 $3 $4 $5 $6 $7"
if [ $? != "0" ]; then
printf "Clearing data failed! Running anyway..."
fi
Make a script like this:
#!/bin/bash
sh -c "$1 $2 $3 $4 $5 $6 $7"
if [ $? != "0" ]; then
printf "Clearing data failed! Running anyway..."
fi
import android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.design.widget.AppBarLayout; | |
import android.util.AttributeSet; | |
/** | |
* When used as the LayoutBehavior of an AppBarLayout, prevents | |
* scrolling by dragging on the AppBarLayout itself | |
* | |
* From https://stackoverflow.com/a/46120228 |
// In project-level build.gradle | |
val navigationVersion by extra("2.0.0") | |
// In app-level build.gradle | |
val navigationVersion: String by rootProject.extra |
import 'package:flutter/material.dart'; | |
class StripeContainer extends StatelessWidget { | |
final Widget child; | |
StripeContainer({@required this.child}); | |
@override | |
Widget build(BuildContext context) { | |
return Container( |
import 'dart:math'; | |
class Person { | |
String firstName; | |
String lastName; | |
String _favoriteColor; | |
String hobby; | |
set favoriteColor(String newFavorite) { | |
print("My favorite color has changed from $_favoriteColor to $newFavorite"); |
This is something I encountered during development of my project Text Torch, and I thought it was interesting enough to write it down here.
The following code snippets are both executed within the context of a fragment. There is a big difference between the following two code snippets. In the first, "fragmentManager" is a property on the fragment containing the whole code snippet. But in the second, it's a property on the newly-created SortTypeDialogFragment, and it actually ends up returning null!
tl;dr: always keep your context in mind when using Kotlin's scope functions, especially when the context inside the scope function is for an object of the same class as the context outside the scope function.
// This did what I wanted
val sortTypeDialogFragment = SortTypeDialogFragment(socialRecordsViewModel.sortType.radioButtonId, socialRecordsViewModel.reversed)
.apply { setTargetFragment(this@StatsFragment, SortTypeDialogFragment.REQUEST_CODE) }
Index: example/lib/main.dart | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- example/lib/main.dart (revision ef4044b05eef89e3fcc85b18e81e2e9d00bcc946) | |
+++ example/lib/main.dart (date 1579027083000) | |
@@ -141,37 +141,13 @@ | |
DateTime now = DateTime.now(); | |
DateTime date = DateTime(now.year, now.month, now.day); |
<!-- You'll need to add all the Bootstrap stuff for this to work --> | |
<p>Click <a href="#" id="popover-link" data-toggle="popover">here</a> to see an image in a popover.</p> | |
<script> | |
window.onload = function () { | |
$("#popover-link").popover({ | |
content: '<img src="https://via.placeholder.com/200x200" width="200" height="200" />', | |
trigger: "focus", | |
html: true | |
}) | |
}; |
<video id="vid" autoplay loop muted> | |
<source src="/vid.mp4" type="video/mp4" /> | |
</video> | |
<script> | |
setTimeout(function() { | |
let vid = document.getElementById("vid"); | |
if (vid.paused) { | |
let message = document.createElement("p"); | |
message.innerHTML = "There's supposed to be a video here, but your browser either " + |
android { | |
signingConfigs { | |
getByName("debug") { | |
keyAlias = "debug" | |
keyPassword = "my debug key password" | |
storeFile = file("/home/miles/keystore.jks") | |
storePassword = "my keystore password" | |
} | |
create("release") { | |
keyAlias = "release" |