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
let required = "1.0.10" | |
let current = "1.0.2" | |
let result = required.compare(current, options: .numeric) | |
print(result.rawValue) |
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
echo "GoogleService start" | |
#rm -rf "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
echo "-----${CONFIGURATION}-----" | |
echo "-----${SRCROOT}-----" | |
if [ "${CONFIGURATION}" = "Debug" ] || [ "${CONFIGURATION}" = "Debug-development" ] || [ "${CONFIGURATION}" = "Release-development" ]; then | |
cp "$SRCROOT/Runner/GoogleService-Info-development.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
echo "Development GoogleService-Info copied." | |
elif [ "${CONFIGURATION}" = "Release" ] || [ "${CONFIGURATION}" = "Release-production" ] || [ "${CONFIGURATION}" = "Debug-production" ]; then |
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
class ScalableImageScreen extends StatelessWidget { | |
final List<String> imageUrls; | |
final int position; | |
ScalableImageScreen({Key key, this.imageUrls, this.position}) | |
: super(key: key); | |
@override | |
Widget build(BuildContext context) { |
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
enum Type { Hoge, Fuga } | |
void main() { | |
print(Type.Hoge.toString()); | |
print(Type.Hoge.toString().split('.')[1]); | |
// output: | |
// Type.Hoge | |
// Hoge | |
} |
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() { | |
// サンプルデータ | |
Map<String, bool> members = Map<String, bool>() | |
..putIfAbsent("userID1", () => true) | |
..putIfAbsent("userID2", () => true); | |
print(members); | |
var transMember = members.entries.map((member) { | |
return <String, dynamic>{member.key: member.value}; | |
}); |
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
// ref) https://gist.github.com/bmcbride/62600e48274961819084 | |
var token = "your gitlab api token"; | |
function onFormSubmit(e) { | |
var title = e.values[2]; | |
var email = e.values[1]; | |
var detail = e.values[3]; | |
var body = " From: "+email+"\n\n" + detail; | |
var labels = "お問い合わせフォームから" |
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
final _textEditingController = TextEditingController(); | |
int _maxLines; | |
@override | |
void initState() { | |
super.initState(); | |
_textEditingController.addListener(_textEditListener); | |
} |
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
inline fun <reified T: Enum<T>> String.enumValueOfOrNull() : T? { | |
return enumValues<T>().find { it.name == this } | |
} | |
enum class SampleEnum(val code:Int) { | |
Ja(1), En(2) | |
} | |
fun main(args: Array<String>) { | |
val sampleString = "Ja" |
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
package net.kwmt27.volleysample.app; | |
import android.app.Application; | |
import android.text.TextUtils; | |
import com.android.volley.Request; | |
import com.android.volley.RequestQueue; | |
import com.android.volley.toolbox.JsonObjectRequest; | |
import com.android.volley.toolbox.Volley; |