Skip to content

Instantly share code, notes, and snippets.

View zackijack's full-sized avatar
🏠
Working from home

Zackky Muhammad zackijack

🏠
Working from home
View GitHub Profile
@zackijack
zackijack / aliases.sh
Created February 9, 2024 09:17
The 'e' function opens files or directories in the appropriate IDE based on their type.
# Opens files or directories in the appropriate IDE based on their type.
e() {
ITEM="${1:-.}"
if [ -d "$ITEM" ]; then
if [ $(find "$ITEM" -name "*.go" | wc -l) -gt 0 ]; then
goland "$ITEM"
elif [ $(find "$ITEM" -name "*.php" | wc -l) -gt 0 ]; then
phpstorm "$ITEM"
elif [ $(find "$ITEM" -name "*.js" | wc -l) -gt 0 ]; then
webstorm "$ITEM"
@zackijack
zackijack / .pre-commit-config.yaml
Created January 5, 2024 08:20
pre-commit configuration for Golang
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- repo: https://github.com/tekwizely/pre-commit-golang
@zackijack
zackijack / kubectl-jq.sh
Created December 10, 2020 10:12
kubectl + jq
# Getting the list of nodes and their memory size
kubectl get nodes -o json | \
jq -r '.items | sort_by(.status.capacity.memory)[] | [.metadata.name,.status.capacity.memory] | @tsv'
# Getting the list of nodes and the number of pods running on them
kubectl get pods -o json --all-namespaces | \
jq '.items | group_by(.spec.nodeName) | map({"nodeName": .[0].spec.nodeName, "count": length}) | sort_by(.count)'
@zackijack
zackijack / Dockerfile
Created January 30, 2020 07:02
Snippet Dockerfile to Add gRPCurl
ARG GRPCURL_VERSION=1.4.0
ARG GRPC_SHA256="71f121bb03d501adcd3c2f946b4914a87133f42ffd6e649b051a9be2cf33690e"
ENV GRPCURL_VERSION=$GRPCURL_VERSION
ENV GRPC_SHA256=$GRPC_SHA256
# Install gRPCurl
RUN curl -L -o grpcurl.tar.gz https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_linux_x86_64.tar.gz \
&& echo "$GRPC_SHA256 grpcurl.tar.gz" | sha256sum -c - \
&& mkdir grpcurl \
&& tar -xzf grpcurl.tar.gz -C grpcurl \
@zackijack
zackijack / git-commit-emoji.md
Last active August 18, 2022 10:03 — forked from parmentf/GitCommitEmoji.md
Emoji for git commit message (compatible for GitHub, Bitbucket, and GitLab)
@zackijack
zackijack / S3-Static-Sites.md
Created February 6, 2018 02:43 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@zackijack
zackijack / emoji.md
Last active January 20, 2018 10:17 — forked from rxaviers/gist:7360908
Complete list of emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@zackijack
zackijack / hosts
Last active January 3, 2019 04:26
/etc/hosts for Vimeo, Reddit, and Telegram. https://support.rackspace.com/how-to/modify-your-hosts-file/
# ---------------------------------------------------
# Vimeo
# ---------------------------------------------------
104.156.85.217 vimeo.com
23.214.58.223 secure-c.vimeocdn.com
74.113.233.128 developer.vimeo.com
80.239.137.98 a.vimeocdn.com
104.156.81.217 player.vimeo.com
23.235.43.249 vimeo-hp-videos.global.ssl.fastly.net