Skip to content

Instantly share code, notes, and snippets.

View mugli's full-sized avatar
🤷

Mehdi Hasan Khan mugli

🤷
View GitHub Profile
@EwoutH
EwoutH / Snapdragon_7_8_series_2024.md
Last active March 20, 2025 09:23
Qualcomm Snapdragon 7 and 8 series spec comparison (2024)

| SoC | Snapdragon 8 Gen 3
(SM8650) | Snapdragon 8s Gen 3
(SM8635) | Snapdragon 8 Gen 2
(SM8550) | Snapdragon 7+ Gen 3
(SM7675-AB) | Snapdragon 7+ Gen 2
(SM7475-AB) | Snapdragon 7 Gen 3
(SM7550-AB) | |----------------------|:---------------------------------------

@khalidx
khalidx / node-typescript-esm.md
Last active April 15, 2025 14:15
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@LevanKvirkvelia
LevanKvirkvelia / nanoBERT.py
Last active October 3, 2024 17:51
nanoBERT, inspired by @karpathy's nanoGPT
import torch.nn as nn
import torch.nn.functional as F
import math
from typing import Optional, Tuple
class BertSelfAttention(nn.Module):
def __init__(self, config):
super().__init__()
if config.hidden_size % config.num_attention_heads != 0:
@MatthewJamesBoyle
MatthewJamesBoyle / DOCKERFILE
Last active March 11, 2024 15:57
production go dockerfile
FROM golang:1.21.0-bullseye as builder
COPY . /workdir
WORKDIR /workdir
ENV CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all"
ENV GOFLAGS="-buildmode=pie"
RUN go build -ldflags "-s -w" -trimpath ./cmd/app
@lainosantos
lainosantos / dell_u2723qe.sh
Last active February 18, 2025 21:01
Basic commands for for KVM, PIP and PBP features for Dell Monitor U2723QE on Linux ddcutil
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ] && groups | grep -qwv 'i2c' && getent group i2c &> /dev/null
then
echo "Insuficient permissions, run as root ou join $USER to i2c group."
exit 1
fi
case "$1" in
@nolanlawson
nolanlawson / scaling_mastodon_down.md
Last active November 17, 2024 16:12
Scaling Mastodon down

Scaling Mastodon down

There is already a guide on scaling your Mastodon server up. This is a short guide on scaling your Mastodon server down.

I.e., maybe you want to run a small instance of <100 active users, and you want to keep your cloud costs reasonable. So you might be running everything on a single machine, with limited memory and CPU. (In my case, I was using a t3.medium instance with 2 vCPUs and 4GB of RAM.) How do you do this?

Note that I'm not a Ruby or Sidekiq expert, and most of this stuff I figured out through trial and error.

@jasnell
jasnell / index.js
Created May 24, 2021 21:58
Getting loopy with JavaScript
'use strict';
const {
createHistogram,
performance: {
timerify
}
} = require('perf_hooks');
const users = [
#!/bin/bash
Counter=20
DisplayHeader="Date Time GPU-C GPU-F CPU-C CPU-F CPU Core Vcore"
while true ; do
let ++Counter
if [ ${Counter} -eq 21 ]; then
echo -e "${DisplayHeader}"
Counter=0
fi
@olets
olets / zsh-plugin-manager-plugin-installation-procedures.md
Last active March 23, 2025 01:00
zsh plugin manager cross-reference

Instructions for installing zsh plugins, for a variety of plugin managers