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
// Based on https://gist.github.com/appsbynight/3681050 by Matt Di Pasquale | |
// Author: Victor Corvalan | |
// http://twitter.com/pescadon | |
// This script will generate squares and wide Icons & Tiles required for Windows Store build on Unity3D | |
// Prepare 1 big icon of 512x512px | |
// Open this script with Photoshop -> File -> Scripts -> Browse | |
// Load your icon when prompted | |
var destFolder; | |
try |
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
# This is a function for capturing screenshots with GDScript | |
func screenshot(): | |
# Capture the screenshot | |
var size = OS.window_size | |
var image = get_viewport().get_texture().get_data() | |
# Setup path and screenshot filename | |
var date = OS.get_datetime() | |
var path = "user://screenshots" | |
var file_name = "screenshot-%d-%02d-%02dT%02d:%02d:%02d" % [date.year, date.month, date.day, date.hour, date.minute, date.second] |
Charts are from different sources and thus colors are inconsistent, please carefully read the chart's legends.
Like this? Check React vs others https://gist.github.com/tkrotoff/b1caa4c3a185629299ec234d2314e190
https://insights.stackoverflow.com/trends?tags=flutter%2Creact-native
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
1.Override CommonActivity's startActivity and finish | |
@Override | |
public void startActivity(Intent intent) { | |
super.startActivity(intent); | |
overridePendingTransition(R.anim.from_right_in, R.anim.from_left_out); | |
} | |
@Override | |
public void finish() { | |
super.finish(); |
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
apply plugin: 'com.android.application' | |
android.applicationVariants.all { variant -> | |
task "copyDependencies${variant.name.capitalize()}"() { | |
outputs.upToDateWhen { false } | |
doLast { | |
println "Executing copyDependencies${variant.name.capitalize()}" | |
variant.getCompileClasspath().each { fileDependency -> | |
def sourcePath = fileDependency.absolutePath | |
def destinationPath = project.projectDir.path + "/build/dependencies/${variant.name}/" |
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
#!/bin/bash | |
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android |
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
import 'dart:convert'; | |
import 'package:my_app/data_model/serializers.dart'; | |
import 'package:flutter/foundation.dart'; | |
Future<T> decodeJson<T>(String res) async { | |
var list = List(); | |
list.add(res); | |
list.add(T); | |
//Replace compute with spawning any other isolate, compute is simpler abstraction of isolate api. |
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
public class RestServiceMockUtils { | |
public static String convertStreamToString(InputStream is) throws Exception { | |
BufferedReader reader = new BufferedReader(new InputStreamReader(is)); | |
StringBuilder sb = new StringBuilder(); | |
String line = null; | |
while ((line = reader.readLine()) != null) { | |
sb.append(line).append("\n"); | |
} | |
reader.close(); |
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
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image); | |
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ | |
//Default | |
imageView.setBackgroundResource(R.drawable.rose); | |
} else { | |
//RoundCorners | |
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap, | |
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius |
NewerOlder