This file contains hidden or 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 final class BaristaUtils { | |
public static void wakeUp() { | |
InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { | |
@Override | |
public void run() { | |
Window window = new ComponentFinder().findCurrentActivity().getWindow(); | |
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | |
} |
This file contains hidden or 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
Index: spoon-runner/src/main/java/com/squareup/spoon/SpoonDeviceRunner.java | |
IDEA additional info: | |
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
<+>UTF-8 | |
=================================================================== | |
--- spoon-runner/src/main/java/com/squareup/spoon/SpoonDeviceRunner.java (revision 0e7361ea1c2926d3953a37a4f62357bc94dde3e2) | |
+++ spoon-runner/src/main/java/com/squareup/spoon/SpoonDeviceRunner.java (revision ) | |
@@ -61,6 +61,7 @@ | |
private final List<String> instrumentationArgs; | |
private final String className; |
This file contains hidden or 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
private Spannable setLightHeaderText(String text, String regexPattern) { | |
final Pattern regPattern = Pattern.compile(regexPattern); | |
final Matcher matches = regPattern.matcher(text); | |
final Spannable spannable = new SpannableString(text); | |
// right now we use first only occurrence if exist | |
if (!matches.find()) { | |
final CustomTypeFaceSpan lightSpanStart = new CustomTypeFaceSpan("roboto-light"); | |
spannable.setSpan(lightSpanStart, 0, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); | |
return spannable; |
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
public class Logger : MonoBehaviour | |
{ | |
public static string URL = "XXX"; | |
void Start() | |
{ |
This file contains hidden or 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 static class FadeoutBehavior extends CoordinatorLayout.Behavior<View> { | |
private int startPos = 0; | |
private int finalPos = 0; | |
@Override | |
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) { | |
return dependency instanceof AppBarLayout; | |
} |
This file contains hidden or 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
# Simple script that generate all possible string combinations for given lenght | |
# and generates sha256 hashes for every combination. Combination allow to use | |
# single char zero or more times. | |
import hashlib | |
import itertools | |
possibleChars = ['a', 'l', 'i', 'n', 's', 'b'] | |
passLen = 7 |
This file contains hidden or 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
/** | |
* Sample oauth2 based on code flow | |
*/ | |
public class MainActivity extends AppCompatActivity { | |
private static final String REDIRECT_URL = "http://redirect.com"; | |
private static final String CLIENT_ID = "your_client_id(oauth_key)"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { |
This file contains hidden or 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
// Custom tasks | |
/** | |
* This test make sure if we have everything committed (or stashed). Allows keep project clean | |
* and with even small change crashlytics beta upload will have different SHA1. | |
*/ | |
task testGitWorkingCopy << { | |
def checkChanges = 'git status -uno --porcelain'.execute([], project.rootDir).text.trim() |
This file contains hidden or 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
android { | |
signingConfigs { | |
release { | |
storeFile file(fileConfig['keystore_dir']) | |
storePassword fileConfig['keystore_password'] | |
keyAlias fileConfig['key_alias'] | |
keyPassword fileConfig['key_password'] | |
} | |
} | |
This file contains hidden or 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
//add it to your build.gradle | |
//every time when your will call task crashlyticsUploadSomethingSomething it will be called before it | |
//and it will crash if you have some uncommited changes in your working copy. | |
// | |
//I'm using this because I need git sha1 for app versioning in development versions. | |
task everythingGitCommited << { | |
def checkChanges = 'git status -uno --porcelain'.execute([], project.rootDir).text.trim() |