Skip to content

Instantly share code, notes, and snippets.

View Albert-W's full-sized avatar
🎯
Focusing

Albert Albert-W

🎯
Focusing
  • Dublin, Ireland
  • 06:57 (UTC +01:00)
View GitHub Profile
@zmb3
zmb3 / static_cgo.md
Created October 5, 2020 15:45
Compile static binaries for Go programs that leverage Cgo.

In order to compile a fully static binary when using Cgo you'll need to link in a C library like musl.

I find it convenient to have a Docker image ready for building these artifacts.

FROM golang
RUN wget https://www.musl-libc.org/releases/musl-1.2.0.tar.gz && \
   tar -zf musl-1.2.0.tar.gz && \
   cd musl-1.2.0 && \
 ./configure --enable-static --disable-shared && \
@mkfares
mkfares / zsh-keyboard-shortucts.md
Last active April 27, 2024 08:49
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@Albert-W
Albert-W / embed gist.md
Last active April 27, 2024 20:35
embed gist in iframe

Embed gist in iframe

it is used to embed gist to an asynchronously-loaded web pages.

<iframe 
    width="100%"
    height="350"    
    src="data:text/html;charset=utf-8,
 
@rbaul
rbaul / CustomSftpProgressMonitor.java
Created January 30, 2019 09:24
SFTP monitoring with JSCH
import com.jcraft.jsch.SftpProgressMonitor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
@RequiredArgsConstructor
public class CustomSftpProgressMonitor implements SftpProgressMonitor {
private final long totalbytes;
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active April 23, 2024 05:58
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@danielalvarenga
danielalvarenga / terminal-colors-branch.sh
Last active March 27, 2024 17:34
Show branch in terminal Ubuntu
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 30, 2024 17:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k