Skip to content

Instantly share code, notes, and snippets.

@devnoname120
devnoname120 / My macOS setup.md
Last active January 27, 2025 17:33
My macOS setup

ℹ️ Enable iCloud end-to-end encryption:

  • Nobody knows that, but iCloud actually supports end-to-end encryption (see “Advanced Data Protection for iCloud”) but it's disabled by default. If you care about data privacy, you should turn it on.
    • System settingsApple IDiCloud → Set Advanced Data Protection to On.
    • System settingsApple IDiCloud → Disable Access iCloud Data on the Web.
  • It supports almost all the native Apple apps, with the notable exceptions of iCloud Mail, Contacts, and Calendars. See official data protection matrix for more info.

Quality of life improvements

Mouse:

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 27, 2025 17:31
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@ngxson
ngxson / FAQ.md
Last active January 27, 2025 17:30
convert ARM NEON to WASM SIMD prompt

Does it work in one-shot or I have to prompt it multiple times?

  • For the qX_0 variants, they are actually quite straight-forward so deepseek can come up with a correct result in 1 shot. It is already crazy enough, given that ChatGPT and Claude have never produced a working result for me.
  • For the qX_K it's more complicated, I would say most of the time I need to re-prompt it 4 to 8 more times.
  • The most difficult was q6_K, the code never works until I ask it to only optimize one specific part, while leaving the rest intact (so it does not mess up everything)

It only does conversion ARM NEON --> WASM SIMD, or it can invent new WASM SIMD code from scratch?

It can do both. For qX_0 I asked it to convert, and for qX_K I asked it to invent new code.

@kdjayakody
kdjayakody / English and Sinhala Combined Latex Paper.txt
Last active January 27, 2025 17:30
English and Sinhala Combined Latex Paper
\documentclass[12pt]{article}
\usepackage[margin=0.25in]{geometry}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{enumitem}
\usepackage{fancyhdr}
% Set main fonts
\setmainfont{Times New Roman}
\setsansfont{Arial}
@elierotenberg
elierotenberg / BLOG.md
Last active January 27, 2025 17:28
Idiomatic Data Fetching using React Hooks

Idiomatic Data Fetching using React Hooks

This post has been written in collaboration with @klervicn

Virtually all web apps and websites need to pull data from a server, usually through a JSON-returning API. When it comes to integrating data fetching in React component, the "impedence mismatch" between the React components, which are declarative and synchronous, and the HTTP requests, which are imperative and asynchronous, is often problematic.

Many apps use third-party libraries such as Redux or Apollo Client to abstract it away. This requires extra dependencies, and couple your app with a specific library to perform data fetching. In most cases, what we want is a direct way to integrate plain HTTP requests (e.g. using native fetch) for usage in React components.

Here we will discuss how we can use React Hooks to do this in an elegant, scalable manner.

@Rich-Harris
Rich-Harris / service-workers.md
Last active January 27, 2025 17:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@bebosudo
bebosudo / gist:7b1c0650e2f94d26afe830530764de65
Created April 15, 2018 14:57
Compile python 3.6 locally, with openssl and sqlite3 support
Create a dir to build things into:
$ mkdir ~/stack && cd ~/stack
Download the sources (sqlite 3230100 was broken, 3220000 was used instead):
$ wget https://www.openssl.org/source/openssl-1.1.0h.tar.gz
$ wget https://sqlite.org/2018/sqlite-src-3220000.zip
$ wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
@willccbb
willccbb / grpo_demo.py
Last active January 27, 2025 17:24
GRPO Llama-1B
# train_grpo.py
import re
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
SYSTEM_PROMPT = """