Skip to content

Instantly share code, notes, and snippets.

View zhanggang807's full-sized avatar
🤗

Dean Zhang zhanggang807

🤗
View GitHub Profile
on run
tell application "Finder" to set aliasItemName to selection as alias
set posixPathName to POSIX path of aliasItemName
return posixPathName
end run
@zhanggang807
zhanggang807 / .ideavimrc
Created March 31, 2023 03:11 — forked from ZhouMoon/.ideavimrc
ideavimr
"____________________________________________________________
"
" /\__\ /\ \ /\ \ /\__\
" /::| | /::\ \ /::\ \ /::| |
" /:|:| | /:/\:\ \ /:/\:\ \ /:|:| |
" /:/|:|__|__ /:/ \:\ \ /:/ \:\ \ /:/|:| |__
" /:/ |::::\__\ /:/__/ \:\__\ /:/__/ \:\__\ /:/ |:| /\__\
" \/__/~~/:/ / \:\ \ /:/ / \:\ \ /:/ / \/__|:|/:/ /
" /:/ / \:\ /:/ / \:\ /:/ / |:/:/ /
" /:/ / \:\/:/ / \:\/:/ / |::/ /
@zhanggang807
zhanggang807 / Item.java
Created January 15, 2020 12:55
递归计算出父的值,父的值由子加和而来
import com.google.common.base.Strings;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@zhanggang807
zhanggang807 / CharsetTest.java
Last active December 10, 2019 06:17
JDK Charset test
public static void main(String[] args) {
//Charset unnderline = Charset.forName("utf_8");//无效
Charset big = Charset.forName("UTF-8");
Charset small = Charset.forName("utf-8");
Charset no1 = Charset.forName("utf8");
Charset no2 = Charset.forName("UTF8");
//上边这四个编码 相同的效果,看来jdk内部会处理大小写和有无短横线的问题
// sun.nio.cs.FastCharsetProvider#lookup 有转换为小写的方法
// sun.nio.cs.UTF_8 这个类是真正的实现类
//System.out.println(unnderline);
@zhanggang807
zhanggang807 / README-Template.md
Created February 17, 2019 15:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@zhanggang807
zhanggang807 / h5-video.html
Created February 16, 2019 13:07
html5 video api study
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>html5-video-study</title>
</head>
@zhanggang807
zhanggang807 / build.gradle
Last active November 11, 2018 08:19
gradel概述task任务入门学习笔记
//使用 gradle task [-q] [--quiet]来执行任务
task HelloWorld {
doFirst {
println 'task at do first point---one'
}
doFirst {
println 'task at do first point---two'
}
//可以添加多个
@zhanggang807
zhanggang807 / StopThread.java
Created October 29, 2018 01:02
线程会停止吗?
import java.util.concurrent.*;
public class StopThread {
private static boolean stopRequested;
public static void main(String[] args) throws InterruptedException {
Thread backgroundThread = new Thread(new Runnable() {
@Override
public void run() {
int i = 0;
@zhanggang807
zhanggang807 / DiffOfTwoList.java
Created October 9, 2018 12:49
guava 两个集合弄找差集
Collection<Long> idOnlyInList1 = Collections2.filter(idList1, Predicates.not(Predicates.in(idList2)));
@zhanggang807
zhanggang807 / Manacher.java
Created October 4, 2018 14:31
最长回文子串算法
public class Manacher{
public static void main(String[] args) {
String line = "ababbbb";
System.out.println("最大回文子串: "+Manacher(line));
}
public static String Manacher(String s) {
// Insert '#'
String t = "$#";
for (int i = 0; i < s.length(); ++i) {