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
#!/usr/bin/env python | |
# coding:utf-8 | |
import os | |
import shutil | |
import zipfile | |
class TextProcesser: | |
def __init__(self, file_path): | |
self.file_path = file_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
default drawable-xxhdpi/, 66% drawable-xhdpi/, 50% drawable-hdpi/, 33% drawable-mdpi/, 25% drawable-ldpi/ | |
default mipmap-xxhdpi/, 66% mipmap-xhdpi/, 50% mipmap-hdpi/, 33% mipmap-mdpi/, 25% mipmap-ldpi/, 125% mipmap-xxxhdpi/ | |
default drawable-xxhdpi/, 66% drawable-xhdpi/, 50% drawable-hdpi/, 33% drawable-mdpi/, 25% drawable-ldpi/ | |
default drawable-xhdpi/, 151% drawable-xxhdpi/, 75% drawable-hdpi/, 50% drawable-mdpi/, 38% drawable-ldpi/ | |
default mipmap-xxhdpi/, 66% mipmap-xhdpi/, 50% mipmap-hdpi/, 33% mipmap-mdpi/, 133% mipmap-xxxhdpi/ | |
default drawable-hdpi/, 200% drawable-xxhdpi/, 133% drawable-xhdpi/, 66% drawable-mdpi/, 50% drawable-ldpi/ |
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); |
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
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
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 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
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
<?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
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) |
OlderNewer