Skip to content

Instantly share code, notes, and snippets.

View Hengliang's full-sized avatar
👋
Hello

HL Hengliang

👋
Hello
View GitHub Profile
@Hengliang
Hengliang / README.md
Last active October 15, 2019 09:27
[Hammerspoon Configuration] #hammerspoon

This Hammerspoon Hyper-Key configuration inspired by Kalis and ttscoff

Thanks a lot! ♥︎

Hotkeys included in the configuration:

  • Hyperkeys
  • Current Time Popup
@Hengliang
Hengliang / git-daily-tricks.md
Last active September 3, 2019 13:10
Git's Basic Commands

Github Resources

  • GitHub Cheat Sheet: A collection of cool hidden and not so hidden features of Git and GitHub.
  • Awesome Github: A curated list of awesome GitHub guides, articles, sites, tools, projects and resources.
  • Awesome Git Addons: A curated list of add-ons that extend/enhance the git CLI.

Git Daily Tricks

Create New Repo and Push

@Hengliang
Hengliang / java-code-gadget.md
Last active June 3, 2021 06:39
[Java Utility Codes] #java

Atomic Operation

// From Netty 3.3.1 Final 
//        \_ org.jboss.netty.channel.AbstractChannel

private static Integer allocateId(Channel channel) {
  Integer id = Integer.valueOf(System.identityHashCode(channel));
  for (;;) {
    // Loop until a unique ID is acquired.
# Terminal output control (http://www.termsys.demon.co.uk/vtansi.htm)
TC='\e['
CLR_LINE_START="${TC}1K"
CLR_LINE_END="${TC}K"
CLR_LINE="${TC}2K"
# Hope no terminal is greater than 1k columns
RESET_LINE="${CLR_LINE}${TC}1000D"