Skip to content

Instantly share code, notes, and snippets.

{
"model": "gpt-4o",
"temperature": 0,
"messages": [
{
"role": "system",
"content": "You are a powerful agentic AI coding assistant designed by Cursor - an AI company based in San Francisco, California. You operate exclusively in Cursor, the world's best IDE.\n\nYou are pair programming with a USER to solve their coding task.\nThe task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.\nEach time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.\nThis information may or may not be relevant to the coding task, it is up for you to decide.\nYour main goal is to follow the USER's instructions at each message.\n\n<communication>\n1. Be concise and do not repeat yourself.\n2. Be conversational but professional.\n3. Refer to the USER in the sec
@mansaj
mansaj / README.md
Created November 28, 2023 00:19 — forked from palewire/README.md
How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

How to push tagged Docker releases to Google Artifact Registry with a GitHub Action

Here's how I configured a GitHub Action so that a new version issued by GitHub's release interface will build a Dockerfile, tag it with the version number and upload it to Google Artifact Registry.

Before you attempt the steps below, you need the following:

  • A GitHub repository that contains a working Dockerfile
  • The Google Cloud SDK tool gcloud installed and authenticated

Create a Workload Identity Federation

@mansaj
mansaj / LearnGoIn5mins.md
Created January 5, 2021 18:12 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
@mansaj
mansaj / LearnGoIn5mins.md
Created January 5, 2021 18:12 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins
@mansaj
mansaj / wget.sh
Created November 20, 2020 05:17 — forked from crittermike/wget.sh
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@mansaj
mansaj / redux-saga.js
Created November 19, 2020 02:50
redux
import { createStore, applyMiddleware } from 'redux';
import createSagaMiddleware from 'redux-saga';
import reducer from './reducer';
import rootSaga from './sagas';
const sagaMiddleware = createSagaMiddleware()
const store = createStore(
reducer,
applyMiddleware(sagaMiddleware)
@mansaj
mansaj / gist:7c0073ba32ad10a6b6d1aeaa31a1d279
Created June 6, 2020 01:01 — forked from akaanirban/gist:621e63237e63bb169126b537d7a1d979
Install pyTorch in Raspberry Pi 4 (or any other)

Install the prerequisites (the last one for numpy):

sudo apt install libopenblas-dev libblas-dev m4 cmake cython python3-yaml libatlas-base-dev

Increase the swap size:

  • Stop the swap : sudo dphys-swapfile swapoff
  • Modify the size of the swap by editing as root the following file : /etc/dphys-swapfile. Modify the valiable CONF_SWAPSIZE and change its value to CONF_SWAPSIZE=2048
  • Run following from command prompt: dphys-swapfile setup to update the changes.
  • Start the swap back again: sudo dphys-swapfile swapon
@mansaj
mansaj / attributes.rb
Created April 24, 2019 16:15 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'