Skip to content

Instantly share code, notes, and snippets.

@danielrbradley
danielrbradley / Pulumi+Prettier+ESLint-setup.md
Created October 22, 2019 10:03
Setting up ESLint & Prettier for Pulumi

Setting up ESLint & Prettier for Pulumi

This is my process for addint ESLint and Prettier support for a new Pulumi TypeScript project.

Install packages

yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint eslint-config-airbnb-base eslint-config-prettier eslint-plugin-import eslint-plugin-prettier prettier
@willccbb
willccbb / grpo_demo.py
Last active April 9, 2025 11:11
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
@aashari
aashari / 00 - Cursor AI Prompting Rules.md
Last active April 9, 2025 11:11
Cursor AI Prompting Rules - This gist provides structured prompting rules for optimizing Cursor AI interactions. It includes three key files to streamline AI behavior for different tasks.

Cursor AI Prompting Framework

This repository provides a structured set of prompting rules to optimize interactions with Cursor AI. It includes three key files to guide the AI’s behavior across various coding tasks.

Files and Their Roles

core.md

  • Purpose: Establishes foundational rules for consistent AI behavior across all tasks.
  • Usage: Place this file in your project’s .cursor/rules/ folder to apply it persistently:
  • Save core.md under .cursor/rules/ in the workspace root.
<context>
# Overview
[Provide a high-level overview of your product here. Explain what problem it solves, who it's for, and why it's valuable.]
# Core Features
[List and describe the main features of your product. For each feature, include:
- What it does
- Why it's important
- How it works at a high level]
# -*- coding: utf-8 -*-
def transliterate(string):
capital_letters = {u'А': u'A',
u'Б': u'B',
u'В': u'V',
u'Г': u'G',
u'Д': u'D',
u'Е': u'E',
@Daethyra
Daethyra / chat_evaluation_single_turn.ipynb
Last active April 9, 2025 11:05
This walkthrough guides you in creating a dataset to evaluate chatbots within multi-turn conversations.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chrislee973
chrislee973 / twitter_bookmarks.js
Last active April 9, 2025 11:05
Liberate your twitter bookmarks
// script modified and adapted from https://gist.github.com/8bitgentleman/de939b391d5d27ee310a0912b2ccba85
(() => {
if (
!location.href.startsWith("https://twitter.com/i/bookmarks") &&
!location.href.startsWith("https://x.com/i/bookmarks")
) {
console.log(location.href);
alert(
"This bookmarklet should only be used on your twitter bookmarks page."
);
@t3dotgg
t3dotgg / try-catch.ts
Last active April 9, 2025 11:03
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@jbfriedrich
jbfriedrich / nsmb.conf
Last active April 9, 2025 11:03
macOS 11.2 NSMB configuration
# /etc/nsmb.conf - macOS 11.3 - 2021-04-29
#------------------------------------------------------------------------------
# SMB configuration for macOS 11.3 <-> Synology
#------------------------------------------------------------------------------
# Additional information:
# -----------------------
# https://support.apple.com/de-de/HT211927
# https://support.apple.com/en-us/HT208209
# https://apple.stackexchange.com/questions/309016/smb-share-deadlocks-since-high-sierra
# https://photographylife.com/afp-vs-nfs-vs-smb-performance
@mara004
mara004 / pypdfjs.py
Last active April 9, 2025 11:02
PDF rendering with pdf.js, from Python
# Four lines intentionally left blank
# SPDX-FileCopyrightText: 2025 geisserml <[email protected]>
# SPDX-License-Identifier: Apache-2.0 OR MPL-2.0
# See also https://github.com/extremeheat/JSPyBridge/blob/master/examples/python/pdfjs.py