Skip to content

Instantly share code, notes, and snippets.

View msaidf's full-sized avatar

Muhamad Said Fathurrohman msaidf

View GitHub Profile
@ivanfioravanti
ivanfioravanti / mlx_memory.sh
Created January 4, 2025 16:42
Script to set MLX memory limits
#!/usr/bin/env bash
# Default values for percentages
DEFAULT_WIRED_LIMIT_PERCENT=85
DEFAULT_WIRED_LWM_PERCENT=75
# Read input parameters or use default values
WIRED_LIMIT_PERCENT=${1:-$DEFAULT_WIRED_LIMIT_PERCENT}
WIRED_LWM_PERCENT=${2:-$DEFAULT_WIRED_LWM_PERCENT}
@veekaybee
veekaybee / chatgpt.md
Last active February 25, 2026 08:47
Everything I understand about chatgpt

ChatGPT Resources

Context

ChatGPT appeared like an explosion on all my social media timelines in early December 2022. While I keep up with machine learning as an industry, I wasn't focused so much on this particular corner, and all the screenshots seemed like they came out of nowhere. What was this model? How did the chat prompting work? What was the context of OpenAI doing this work and collecting my prompts for training data?

I decided to do a quick investigation. Here's all the information I've found so far. I'm aggregating and synthesizing it as I go, so it's currently changing pretty frequently.

Model Architecture

@jimbrig
jimbrig / installs.ps1
Created March 25, 2022 14:08
Scoop Configuration and Installation for R
# check execution policy
If ((Get-ExecutionPolicy) -eq 'Restricted') {
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
}
# check powershell $PROFILE
If (!(Test-Path $PROFILE)) {
Write-Host "No PowerShell $PROFILE detected, creating one.." -ForegroundColor Magenta
New-Item -ItemType File -Path $PROFILE -Force
Write-Host "Created PowerShell Profile at: $PROFILE" -ForegroundColor Green
@hankroark
hankroark / interp_urdf.R
Created October 21, 2019 20:04
This R function helps to interpret the output of the urca::ur.df function
############################################################################################
# This R function helps to interpret the output of the urca::ur.df function.
# The rules are based on https://stats.stackexchange.com/questions/24072/interpreting-rs-ur-df-dickey-fuller-unit-root-test-results
#
# urdf is the output of the urca::ur.df function
# level is one of c("1pct", "5pct", "10pct")
#
# Author: Hank Roark
# Date: October 2019
############################################################################################
@johnjosephhorton
johnjosephhorton / lazy_way_to_install_all_R_packages.sh
Created July 26, 2019 13:46
Lazy way to get all the packges you use & then install them at once
# Find all your R files & get just the package names, uniquely
find ../analysis/ -name *R -print0 | xargs -0 grep -h 'library*' | sed 's/library//g' | sed 's/#//g' | sed 's/ //g' | sort | uniq|\
sed 's/(//g' | sed 's/)//g' > package_list.txt
# Install each package
cat package_list.txt | xargs -I {} Rscript -e 'install.packages("{}")'
@ubergesundheit
ubergesundheit / 000-tunneld-server.md
Last active September 21, 2021 00:14
Ngrok alternative with mmatczuk/go-http-tunnel server
@siayi
siayi / Format Pencarian Titik Koordinat Desa di Google Maps.md
Last active October 12, 2024 15:59
Format Pencarian Titik Koordinat Desa di Google Maps

Format Pencarian Titik Koordinat Desa di Google Maps

Format Pencarian Titik Koordinat Desa di Google Maps

Format:

[nama desa], [nama kecamatan], [nama kabupaten/kota], [nama provinsi]

Contoh:

Ciburial, Cimenyan, Bandung, Jawa Barat

@pjeby
pjeby / shelldown-demo
Last active May 28, 2025 08:18
"You got your markdown in my shell script!" "No, you got your shell script in my markdown!"

Mixed Markdown and Shell Scripting

: By the power of this magic string: ex: set ft=markdown ;:<<'```shell' #, this file is now both a markdown document and an executable shell script. chmod +x it and try running it!

The above line does just what it says. More specifically, when placed within in the first 5 lines and preceded only by blank lines or #-prefixed markdown headers:

  1. The first part of the magic string makes github and various editors (e.g. atom with the vim-modeline packge) treat the file as having markdown syntax (even if the file doesn't have an extension)
  2. The second part (if run in a shell), makes the shell skip execution until it encounters the next ```shell block.

(The line also has to start with a : so that it's valid shell code.)

@mbrehin
mbrehin / msoffice_ooffice_pdf_diffs_with_git.md
Last active February 27, 2026 20:16
Microsoft Office, Open Office, PDF diffs with Git

Sometimes when working with Git you'd like to commit binary files.
But those files won't have clean comparisons with Git standard diff command.
Fortunately Git is a great tool that comes with a lot of possibilities…

MS Office

If, as a developer, you are under company constraints and must use MS Office,
you'll encounter some issues when trying to diff MS Office files.

Maybe you're asking yourself: what's the problem with that?

@MattDMo
MattDMo / ipy_repl.py
Last active April 3, 2022 23:16
SublimeREPL ipy_repl.py for running IPython/Jupyter in Sublime Text
# from https://gist.github.com/MattDMo/6cb1dfbe8a124e1ca5af
import os
import json
import socket
import threading
activate_this = os.environ.get("SUBLIMEREPL_ACTIVATE_THIS", None)
# turn off pager