Skip to content

Instantly share code, notes, and snippets.

View zhanggang807's full-sized avatar
🤗

Dean Zhang zhanggang807

🤗
View GitHub Profile
@ZhouMoon
ZhouMoon / .ideavimrc
Created March 26, 2023 12:48
ideavimr
"____________________________________________________________
"
" /\__\ /\ \ /\ \ /\__\
" /::| | /::\ \ /::\ \ /::| |
" /:|:| | /:/\:\ \ /:/\:\ \ /:|:| |
" /:/|:|__|__ /:/ \:\ \ /:/ \:\ \ /:/|:| |__
" /:/ |::::\__\ /:/__/ \:\__\ /:/__/ \:\__\ /:/ |:| /\__\
" \/__/~~/:/ / \:\ \ /:/ / \:\ \ /:/ / \/__|:|/:/ /
" /:/ / \:\ /:/ / \:\ /:/ / |:/:/ /
" /:/ / \:\/:/ / \:\/:/ / |::/ /
@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
" :actionlist可以查询所有命令
" 基本思路
" w 比如全屏、分屏
" g 跳转
" z 比如打开最近修改的文件那种了
" q 关闭标签
" e 运行/调试
" t 任务
set showmode
@skyzyx
skyzyx / homebrew-gnubin.md
Last active April 24, 2024 00:04
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@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
@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);
@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.
@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
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@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