Skip to content

Instantly share code, notes, and snippets.

View phellipealexandre's full-sized avatar
🎯
Focusing

Phellipe Silva phellipealexandre

🎯
Focusing
View GitHub Profile
adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0
disable-animations:
adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0
[Comando]: [Comando dependencia 1] ... [Comando-dependencia N]
(Tab ↹)[instrução 1]
.
.
.
(Tab ↹)[instrução n]
disable-animations:
adb shell settings put global window_animation_scale 0
adb shell settings put global transition_animation_scale 0
adb shell settings put global animator_duration_scale 0
clear-app-data:
adb shell pm clear com.phellipesilva.coolposts
run-instrumented-tests: clear-app-data disable-animations
./gradlew connectedAndroidTest
.PHONY: app
app:
[Instrução]
public class IslandMatrixCalculator {
public int calculateNumberOfIslands(int[][] matrix) {
int islands = 0;
if (matrix.length == 0) return islands;
for (int i=0; i<matrix.length; i++) {
for (int j=0; j<matrix[0].length; j++) {
if (matrix[i][j] == 1) {
removeIsland(matrix, i, j);
[Command]: [Dependent Command 1] ... [Dependent Command N]
(Tab ↹)[Instruction 1]
.
.
.
(Tab ↹)[Instruction N]
.PHONY: app
app:
[Instruction]
@phellipealexandre
phellipealexandre / DummyExample.kt
Created November 11, 2020 01:18
Exemplo simples de utilização de um Dummy em um teste
@Test
fun `Update registered note count when registering a new note in empty repository`() {
val dummyNote = //Dublê de teste Dummy
//Passado apenas preencher o parâmetro, o conteúdo do dublê não é tão relevante
noteRepository.registerNote(dummyNote)
assertEquals(expected = 1, actual = noteRepository.getNoteCount())
}
@phellipealexandre
phellipealexandre / OtherDummies.kt
Created November 11, 2020 01:30
Dummies gerados sem ajuda de ferramentas
val dummyPrice = 10.0 //Dummy literal
val dummyUniqueCustomerNumber = getUniqueNumber() //Dummy auto gerado