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
@gengwg
gengwg / Llama-2-13B-chat-M1.md
Last active October 12, 2023 12:22
Run Llama-2-13B-chat locally on M1 Macbook with GPU inference

Clone

gengwg@gengwg-mbp:~$ git clone https://github.com/ggerganov/llama.cpp.git
Cloning into 'llama.cpp'...
remote: Enumerating objects: 5267, done.
remote: Counting objects: 100% (2065/2065), done.
remote: Compressing objects: 100% (320/320), done.
remote: Total 5267 (delta 1878), reused 1870 (delta 1745), pack-reused 3202
Receiving objects: 100% (5267/5267), 4.24 MiB | 13.48 MiB/s, done.
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 22, 2024 08:47
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@akash-gajjar
akash-gajjar / backup-restore.sh
Last active June 22, 2023 12:42
A script to perform backup and restore operations for a MongoDB database.
#!/bin/bash
# Script: backup-restore.sh
# Description: A script to perform backup and restore operations for a MongoDB database.
# Author: Aakash Gajjar
# Last modified: 2023-06-03
# S3 bucket to upload database backup file
bucketName=""
@nicholashagen
nicholashagen / README.md
Created September 24, 2022 19:48
Five Star Architecture

Five Star Architecture

Being apart of several different architecture teams throughout my career, I have learned alot about data organization from the core data to the frontend interfaces to everything in-between. Generally, every single architecture survives off what I am coining as the Five Star Architecture (FSA). The FSA essentially encompasses five different tiers, each with their specific resposibilities and methodologies.

The following is a high-level diagram of the tiers including the communication protocol(s):

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' && \
@phatnguyenuit
phatnguyenuit / how-to-sort-imports-like-a-pro.md
Last active May 23, 2024 15:20
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!

@davidteren
davidteren / nerd_fonts.md
Last active June 27, 2024 21:32
Install Nerd Fonts via Homebrew [updated & fixed]
@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

@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"'"}' \
@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';