Skip to content

Instantly share code, notes, and snippets.

@koinzhang
koinzhang / simple-applescript.applescript
Last active June 27, 2024 13:49
Simple AppleScript
-- Show system hidden files
tell application "Finder" to quit
tell application "System Events" to do shell script "defaults write com.apple.finder AppleShowAllFiles -bool true"
tell application "Finder" to launch
-- copy file to clipboard
tell app "Finder" to set the clipboard to (POSIX file "/Users/zhangyongkang/Desktop/Markdown.md")
@koinzhang
koinzhang / GenerateDimenTool.java
Last active February 20, 2022 11:28
[DimenTool] 安卓Dimension生成工具 #Java
public class GenerateDimenTool {
public static void main(String[] args) {
StringBuilder sw400 = new StringBuilder();
//添加xml开始的标签
String xmlStart = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<resources>\n";
sw400.append(xmlStart);
//添加内容
for (int i = 0; i <= 1920; i++) {
// 此处name后的标签名可以自定义"margin_"随意更改
@koinzhang
koinzhang / BitmapUtils.kt
Last active July 2, 2022 02:59
[Utils] Android Utils Code
import android.content.Context
import android.graphics.*
import android.graphics.Bitmap.CompressFormat
import android.graphics.drawable.Drawable
import android.renderscript.Allocation
import android.renderscript.Element
import android.renderscript.RenderScript
import android.renderscript.ScriptIntrinsicBlur
import android.text.TextUtils
import android.util.Log