Skip to content

Instantly share code, notes, and snippets.

View akash-gajjar's full-sized avatar
🎯
Focusing

Aakash Gajjar akash-gajjar

🎯
Focusing
View GitHub Profile
@paolocarrasco
paolocarrasco / README.md
Last active July 11, 2025 09:57
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@shcallaway
shcallaway / apply-ecr-lifecycle-policy.sh
Last active May 30, 2023 07:00
Apply the same lifecycle policy to all AWS ECR repositories
#!/bin/bash
aws ecr describe-repositories | jq '.repositories[].repositoryName' | xargs -I {} aws ecr put-lifecycle-policy --repository-name {} --lifecycle-policy-text "file://policy.json"
@shu-yusa
shu-yusa / create_jwt.sh
Last active May 10, 2025 22:21
Generate private and public keys, and create JWT and JWKs
#!/bin/sh
## Requires openssl, nodejs, jq
header='
{
"kid": "12345",
"alg": "RS256"
}'
payload='
{
"iss": "https://example.com",
@seeliang
seeliang / lint-only-changed-files.MD
Last active December 2, 2024 05:08
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@donaldpipowitch
donaldpipowitch / README.md
Last active June 13, 2022 04:24
React - Error Boundary strategy

One cool feature of React which isn't highlighted that often are "error boundaries".

Error boundaries can catch errors which are thrown inside your component during a lifecycle. You can use them in very fine-granular levels wrapping very small components (but I rarely see this) or you can wrap your whole app and show some fallback content, if an error happens. But you can also wrap something in between those extrem ranges and add a proper reset. Also it's not a hidden secret how to do that I haven't see a lot of people talking about that. So here is a small example which use react-router-dom to do that. You can see the complete example here.

Let's imagine you have the following app:

import * as React from 'react';
import { render } from 'react-dom';
import { Link, BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';
@julia-mareike
julia-mareike / slack-notification.sh
Created June 16, 2020 01:36
Send slack message via curl
#!/bin/bash
MESSAGE="Message"
SLACK_CHANNEL="#slack-channel"
SLACK_TOKEN=xoxb-1234-000000000000
curl -X POST \
-H "Authorization: Bearer $SLACK_TOKEN" \
-H "Content-type: application/json; charset=utf-8" \
--data '{"channel":"'$SLACK_CHANNEL'","text":"'"$MESSAGE"'"}' \
@pi0neerpat
pi0neerpat / verdaccio.md
Created August 19, 2020 18:51
How to self host Verdaccio

Private Package Repositories

  • npm.org Private Packages link
  • Options for self-hosting private package repos link

Verdaccio

About Verdaccio link

Useful Commands

@davidteren
davidteren / nerd_fonts.md
Last active July 2, 2025 14:14
Install Nerd Fonts via Homebrew [updated & fixed]
@phatnguyenuit
phatnguyenuit / how-to-sort-imports-like-a-pro.md
Last active March 11, 2025 07:17
How to sort imports like a pro in TypeScript

How to sort imports like a pro in TypeScript

Crossing reviews becomes a very common activity today in engineering behavior. To help us review changes for pull/merge requests easier, sorting imports can help us a much. The codebase becomes more professional and more consistent, reviewers will be happier, and the review process will be faster, focusing on the implementation changes ONLY.

Have you ever thought about how to sort imports in TypeScript projects automatically?

Let me show you how to archive sorting imports automatically in TypeScript projects with ESLint!

FROM node:slim
# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \