Skip to content

Instantly share code, notes, and snippets.

View zhanggang807's full-sized avatar
🤗

Dean Zhang zhanggang807

🤗
View GitHub Profile
/*
* $Id$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
@rednaxelafx
rednaxelafx / Fib.java
Created March 7, 2017 01:07
Yet another naive Fibonacci example
import java.util.*;
public class Fib {
static int o = 0;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
long start = System.currentTimeMillis();
int answer = fib(n);
@vaskoz
vaskoz / Deps.java
Created July 17, 2013 07:40
An example of "jdeps" command line tool in Java 8 with JDeps usage help and 3 different outputs of -v (verbose) -P (profile) and -R (recursive)
import java.util.Set;
import java.util.HashSet;
public class Deps {
public static void main(String[] args) {
System.out.println(Math.random());
Set<String> set = new HashSet<>();
}
}
@timlien
timlien / IntelliJ IDEA.app.vmoptions
Created June 15, 2018 09:37
IntelliJ IDEA 2018 JVM optimization
# IntelliJ IDEA vm options
-ea
-server
-Xms2G
-Xmx4096M
-Xss2m
-XX:MaxMetaspaceSize=2G
-XX:ReservedCodeCacheSize=1G
-XX:MetaspaceSize=512m
@Rican7
Rican7 / upgrade-osx-bash.sh
Created September 15, 2016 23:11
Upgrade Bash on Mac OS X
#/usr/bin/env sh
#
# Requires homebrew (http://brew.sh/)
# Thanks http://clubmate.fi/upgrade-to-bash-4-in-mac-os-x/
brew update && brew install bash && sudo bash -c 'echo /usr/local/bin/bash >> /etc/shells' && chsh -s /usr/local/bin/bash
" :actionlist可以查询所有命令
" 基本思路
" w 比如全屏、分屏
" g 跳转
" z 比如打开最近修改的文件那种了
" q 关闭标签
" e 运行/调试
" t 任务
set showmode
@p1nox
p1nox / using_meld_on_mac.md
Last active June 13, 2023 16:24
Using meld on Mac

Using Meld merging tool on Mac

There are two ways of installing meld on osx (May 2023), using brew and .dmg package (from @yousseb). Since I found https://yousseb.github.io/meld/, I've installed it with .dmg package, but having macOS Ventura Version 13.4 (22F66) in place, it's not even starting for me. So I tried brew installation, and the application is working as expected, including symlink to start it from the terminal.

brew install --cask meld

# set meld as your default git mergetool
@thbkrkr
thbkrkr / list.rb
Last active July 25, 2023 07:54
Kafka JMX MBeans list
com.sun.management:type=DiagnosticCommand
com.sun.management:type=HotSpotDiagnostic
java.lang:name=CodeCacheManager,type=MemoryManager
java.lang:name=Code Cache,type=MemoryPool
java.lang:name=Compressed Class Space,type=MemoryPool
java.lang:name=G1 Eden Space,type=MemoryPool
java.lang:name=G1 Old Generation,type=GarbageCollector
java.lang:name=G1 Old Gen,type=MemoryPool
java.lang:name=G1 Survivor Space,type=MemoryPool
java.lang:name=G1 Young Generation,type=GarbageCollector
@bitmingw
bitmingw / git_batch_resolver.py
Last active September 18, 2023 08:20
Batch script to resolve large git conflicts.
#!/usr/bin/env python3
"""
Author: Ming Wen (bitmingw@gmail.com)
When resolving conflicts on a merge or rebase, this script
automates `git add/rm` and `git checkout` with --ours or --theirs
for a large batch of changes.
Usage: `python3 git_batch_resolver.py` in your git repository.
@sunzsh
sunzsh / 系统当前选中文件路径.applescript
Last active December 7, 2023 06:20
alfred获取当前选中的文件路径
on run
tell application "Finder" to set aliasItemName to selection as alias
set posixPathName to POSIX path of aliasItemName
return posixPathName
end run