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
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
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
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
private static abstract class Transform1<T, M> { | |
abstract M transform(T input); | |
} | |
private <InputType, OutputType, InputList extends List<InputType>, OutputList extends List<OutputType>> OutputList map (InputList input, Transform1<InputType, OutputType> transform1) { | |
List<OutputType> out = new ArrayList<>(); | |
for (InputType i : input) { | |
out.add(transform1.transform(i)); | |
} |
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
// JacksonGetter | |
#set($const_name = $helper.getPropertyName($field, $project).toString().replaceAll("([A-Z]+)","\_$1").toUpperCase()) | |
@JsonProperty(${const_name}) | |
@Nullable | |
#if($field.modifierStatic) | |
static ## | |
#end | |
$field.type ## | |
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project)))) | |
#if ($field.boolean && $field.primitive) |
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 class BitmapUtils { | |
public static Bitmap cropCircleCenterBitmap(Bitmap bitmap) { | |
int size; | |
int x; | |
int y; | |
// calculate square bitmap | |
if (bitmap.getWidth() >= bitmap.getHeight()) { | |
x = bitmap.getWidth() / 2 - bitmap.getHeight() / 2; | |
y = 0; | |
size = bitmap.getHeight(); |
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
import android.app.Activity | |
import android.support.annotation.IdRes | |
import android.view.View | |
fun <T : View> Activity.bind(@IdRes idRes: Int): Lazy<T> { | |
@Suppress("UNCHECKED_CAST") | |
return unsafeLazy { findViewById(idRes) as T } | |
} | |
fun <T : View> View.bind(@IdRes idRes: Int): Lazy<T> { |
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
#include <iostream> | |
#include <fstream> | |
int main() { | |
std::fstream plik; | |
bool pierwszy = true; | |
if (pierwszy) { | |
plik.open("file_load.cpp", std::ios::in); | |
} else { | |
plik.open("file_load.cpp", std::ios::in); |
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
"""Script for converting PacktPub ebooks names in current directory. | |
Usage: | |
To execute just put script in ebook directory (subdirs will not work). | |
Todo: | |
- Detect unsupported or already converted file names. | |
""" | |
#!/usr/bin/python3 | |
#-*- encoding: utf-8 -*- |