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 SelfReturningAnswer implements Answer<Object> { | |
public Object answer(InvocationOnMock invocation) throws Throwable { | |
Object mock = invocation.getMock(); | |
if( invocation.getMethod().getReturnType().isInstance( mock )){ | |
return mock; | |
} | |
else{ | |
return RETURNS_DEFAULTS.get().answer(invocation); | |
} |
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
M117 Cooling down... | |
M104 S0 ; turn off extruder | |
M107 ; Fan off | |
M140 S0; Turn bed off | |
M84 ; disable motors | |
G91 ;relative positioning | |
G1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure | |
G1 Z+0.5 E-5 ;X-20 Y-20 F240 ;move Z up a bit and retract filament even more | |
G28 X0 ;move X to min endstops, so the head is out of the way | |
G90 ;Absolute positionning |
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 LeanbackUtil { | |
/** | |
* Returns true if the Leanback System feature is available otherwise false | |
* | |
* Can be used to help determine if running on an android tv device with the leanback launcher. | |
*/ | |
public static boolean isLeanbackSupported(Context context) { | |
final PackageManager pm = context.getPackageManager(); | |
return pm.hasSystemFeature("android.software.leanback"); | |
} |
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 | |
sudo /sbin/rmmod kvm_intel | |
sudo /sbin/rmmod kvm | |
sudo /etc/init.d/vboxdrv start |
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 SchoolViewHolder extends RecyclerView.ViewHolder { | |
private ItemSchoolBinding binding; | |
// @VisibleForTesting | |
// protected EventBus eventBus = EventBus.getDefault(); | |
private EventBus eventBus; | |
public SchoolViewHolder(@NonNull View itemView) { |
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.abercrombie.testing.ui.rules | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.ExperimentalCoroutinesApi | |
import kotlinx.coroutines.test.TestCoroutineDispatcher | |
import kotlinx.coroutines.test.TestCoroutineScope | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.runBlockingTest | |
import kotlinx.coroutines.test.setMain | |
import org.junit.rules.TestRule |
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
subprojects { | |
apply plugin: "com.diffplug.gradle.spotless" | |
spotless { | |
format 'xml', { | |
target '**/layout*/*.xml' | |
indentWithSpaces(2) | |
eclipseWtp('xml').configFile rootProject.file('spotless.xml.prefs') | |
} | |
} |
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
ffmpeg -loglevel 99 -i "https://webcamstream.multivista.com/live/amlst:dal_59169_1.stream/chunklist_w95623917_b300000.m3u8" -ss 00:00:14.435 -vframes 1 -strftime 1 "%Y-%m-%d_%H-%M-%S_crew_stadium.png" |
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
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); | |
intent.addCategory(Intent.CATEGORY_OPENABLE); | |
intent.setType("*/*"); | |
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); | |
// In code that handles the result returned to process the files: | |
ClipData clipData = intent.getClipData(); |
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/sh | |
commit_regex='^(PP-[0-9]+|fixup!)' | |
error_msg="Aborting commit. Your commit message is missing a JIRA ticket ('PP-1234')" | |
if ! grep -iqE "$commit_regex" "$1"; | |
then | |
echo "$error_msg" >&2 | |
exit 1 |
NewerOlder