Action | Shortcut |
---|---|
switch fullscreen mode | Ctrl +f |
resize window to 1:1 (pixel-perfect) | Ctrl +g |
resize window to remove black borders | Ctrl +x | Double-click¹ |
click on HOME |
Ctrl +h | Middle-click |
click on BACK |
Ctrl +b | Right-click² |
click on APP_SWITCH |
Ctrl +m |
import 'dart:async'; | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/cupertino.dart'; | |
/// [LoggingInterceptor] is used to print logs during network requests. | |
/// It's better to add [LoggingInterceptor] to the tail of the interceptor queue, | |
/// otherwise the changes made in the interceptor behind A will not be printed out. | |
/// This is because the execution of interceptors is in the order of addition. | |
class LoggingInterceptor extends Interceptor { |
extension DateTimeX<T extends DateTime> on T { | |
DateTime copyWith({ | |
int year, | |
int month, | |
int day, | |
int hour, | |
int minute, | |
int second, | |
int millisecond, | |
int microsecond, |
#!/usr/bin/env bash | |
cwd="$(pwd)" | |
find . -print0 -type d | while IFS= read -r -d '' file; do | |
if [ ! -d "${file}/.git" ]; then | |
continue | |
fi | |
cd "${file}" | |
if [[ -n $(git status -s) ]]; then |
import java.lang.ProcessBuilder.Redirect | |
import java.util.concurrent.TimeUnit | |
fun String.runCommand(workingDir: File? = null) { | |
val process = ProcessBuilder(*split(" ").toTypedArray()) | |
.directory(workingDir) | |
.redirectOutput(Redirect.INHERIT) | |
.redirectError(Redirect.INHERIT) | |
.start() | |
if (!process.waitFor(10, TimeUnit.SECONDS)) { |
<templateSet group="TimberJava"> | |
<template name="timd" value="timber.log.Timber.d("$METHOD_NAME$: $content$");" description="Timber.d(String)" toReformat="true" toShortenFQNames="true"> | |
<variable name="METHOD_NAME" expression="methodName()" defaultValue="" alwaysStopAt="false" /> | |
<variable name="content" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_STATEMENT" value="true" /> | |
</context> | |
</template> | |
<template name="time" value="timber.log.Timber.e($exception$, "$METHOD_NAME$: $content$");" description="Timber.e(Exception, String)" toReformat="true" toShortenFQNames="true"> | |
<variable name="exception" expression="" defaultValue="e" alwaysStopAt="true" /> |
/* Copyright 2016 Patrick Löwenstein | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, |
{ fontWeight: '100' }, // Thin | |
{ fontWeight: '200' }, // Ultra Light | |
{ fontWeight: '300' }, // Light | |
{ fontWeight: '400' }, // Regular | |
{ fontWeight: '500' }, // Medium | |
{ fontWeight: '600' }, // Semibold | |
{ fontWeight: '700' }, // Bold | |
{ fontWeight: '800' }, // Heavy | |
{ fontWeight: '900' }, // Black |
Kotlin is a programming language backed by JetBrains, the company that develops IntelliJ IDEA, which is the backend of Android Studio. After five years of development, version 1.0 was released in February, 2016. Kotlin compiles to JVM bytecode that is fully compatible with the Android platform. The developers even pay special attention to it by providing libraries (for example Anko), tooling and more.
It is a language designed for interoperability with Java code, which allows for a gradual migration from Java to Kotlin. The tooling is great and aids usability much. Additionally, picking up the language is very easy if you already know Java, since the syntax and concepts are similar, while still providing a lot of value for developers held back by the bad Java support on Android. Most developers are currently limited to Java 7 or even Java 6 and it will take a long time before we'll be able to properly use features like lambda expressions to make code mo