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 java.util.regex.Matcher | |
import java.util.regex.Pattern | |
fun String.unicode(): String { | |
return unicodeToUtf8().unicodeToUtf8(16) | |
} | |
fun String.unicodeToUtf8(radix: Int = 10): String { | |
val p = Pattern.compile(if (radix == 10) "&#(\\d+);|." else "&#x(.+?);|.") | |
val sb = StringBuilder() |
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
default android/drawable-mdpi/, 150% android/drawable-hdpi/, 200% android/drawable-xhdpi/, 300% android/drawable-xxhdpi/, 400% android/drawable-xxxhdpi/, 100% iphone/, 200% iphone/@2x, 300% iphone/@3x |
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
from PIL import Image | |
from os import rename, listdir | |
from webptools import webplib as webp | |
basewidth = 512 | |
path = "webp" | |
fnames = listdir(path) | |
for fname in fnames: | |
if fname.startswith("sk") and fname.endswith(".png") and not fname.endswith("_temp.png"): | |
im = Image.new("RGBA", (basewidth, basewidth), 0) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TextView | |
android:layout_width="wrap_content" |
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
DELETE FROM sds; | |
INSERT INTO table1 ( | |
column1, | |
column2 ,..) | |
VALUES | |
(value1, | |
value2 ,...), | |
(value1, | |
value2 ,...), | |
(value1, |
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 RealmHelper { | |
public static <T extends RealmObject> void save(T object) { | |
Realm realm = Realm.getDefaultInstance(); | |
try { | |
realm.beginTransaction(); | |
realm.copyToRealmOrUpdate(object); | |
realm.commitTransaction(); | |
} finally { | |
realm.close(); | |
} |
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 jp.mediaid.nge.library.categories.ui; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.DashPathEffect; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.Rect; | |
import android.os.Build; |
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 static void changeColorScrollBar(View Scroll, int color, Context cxt){ | |
try | |
{ | |
Field mScrollCacheField = View.class.getDeclaredField("mScrollCache"); | |
mScrollCacheField.setAccessible(true); | |
Object mScrollCache = mScrollCacheField.get(Scroll); | |
Field scrollBarField = mScrollCache.getClass().getDeclaredField("scrollBar"); | |
scrollBarField.setAccessible(true); | |
Object scrollBar = scrollBarField.get(mScrollCache); |
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
Step 1: Open up a Terminal window (this is in your Applications/Utilites folder by default) | |
Step 2: Enter the follow commands: | |
touch ~/.bash_profile; open ~/.bash_profile | |
This will open the .bash_profile file in Text Edit (the default text editor included on your system). The file allows you to customize the environment your user runs in. | |
Step 3: Add the following line to the end of the file adding whatever additional directory you want in your path: |
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
PackageInfo info; | |
try { | |
info = getPackageManager().getPackageInfo("com.you.name", PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md; | |
md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
String something = new String(Base64.encode(md.digest(), 0)); | |
//String something = new String(Base64.encodeBytes(md.digest())); | |
Log.e("hash key", something); |
NewerOlder