// variable
int x = 1;
// constant
final int y = 2;
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 com.example.android; | |
import android.content.Context; | |
import android.widget.ImageView; | |
import android.util.AttributeSet; | |
import android.content.res.TypedArray; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.view.animation.AnimationUtils; | |
import android.view.animation.Animation; |
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 StringUtils.encodeHex | |
import java.io.File | |
import java.io.FileInputStream | |
import java.io.InputStream | |
import java.security.MessageDigest | |
object HashUtils { | |
const val STREAM_BUFFER_LENGTH = 1024 |
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 | |
if [ $# -ne 2 ]; then | |
echo "Usage: $0 file partSizeInMb"; | |
exit 0; | |
fi | |
file=$1 | |
if [ ! -f "$file" ]; 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
fun Project.android(): BaseExtension { | |
val android = project.extensions.findByType(BaseExtension::class.java) | |
if (android != null) { | |
return android | |
} else { | |
throw GradleException("Project $name is not an Android project") | |
} | |
} | |
fun BaseExtension.variants(): DomainObjectSet<out BaseVariant> { |
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
/* | |
* Copyright 2017 Shazam Entertainment Limited | |
* | |
* 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, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | |
*/ |
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
/** | |
* List all Dependencies of main / subprojects for given configurations. | |
*/ | |
task allDependencies { | |
doLast { | |
// only check defined configurations | |
def includedConfigurations = ['compile', 'testCompile', 'runtime'] | |
def deps = [:] |
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}/" |
When setting these options consider the following:
- How long is your average request?
- What is the maximum number of simultaneous visitors the site(s) get?
- How much memory on average does each child process consume?
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
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
adb help // List all comands | |
== Adb Server | |
adb kill-server | |
adb start-server | |
== Adb Reboot | |
adb reboot | |
adb reboot recovery | |
adb reboot-bootloader |