Skip to content

Instantly share code, notes, and snippets.

@thilllon
thilllon / default.md
Created July 25, 2025 06:59 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@thilllon
thilllon / .bash_profile
Created July 15, 2024 03:43 — forked from KennethanCeyer/.bash_profile
bash_profile for MAC users
#.bash_profile
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
#============================================================
#
# ALIASES AND FUNCTIONS
# Arguably, some functions defined here are quite big.
# If you want to make this file smaller, these functions can
@thilllon
thilllon / extract variables only from class
Created May 13, 2023 02:39
build interface from class extracting variables only exclude methods
import { ClassConstructor } from 'class-transformer';
/* eslint-disable @typescript-eslint/ban-types */
class MyClass {
foo: string;
bar: number;
baz() {
// ...
return true;
}
@thilllon
thilllon / extractEnvs.js
Created September 29, 2022 15:46
extract dotenv(.env) files with maintaining directory structure
const fs = require('fs');
const glob = require('glob');
const { path: rootDir } = require('app-root-path');
const path = require('path');
const destPath = path.join(rootDir, 'envs' + Date.now());
if (fs.existsSync(destPath)) {
fs.rmSync(destPath, { force: true, recursive: true, maxRetries: 3, retryDelay: 1000 });
}
fs.mkdirSync(destPath);
@thilllon
thilllon / esm-package.md
Created August 7, 2022 21:09 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
// https://next-auth.js.org/adapters/mongodb#usage
// This approach is taken from https://github.com/vercel/next.js/tree/canary/examples/with-mongodb
import { MongoClient } from 'mongodb';
declare global {
// eslint-disable-next-line no-var
var _mongoClientGlobal: Promise<MongoClient>;
}
@thilllon
thilllon / node_nginx_ssl.md
Created December 5, 2021 17:20 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@thilllon
thilllon / Readme.md
Created November 20, 2021 12:01 — forked from OlivierLDff/Readme.md
🚀 Git Bash Emojis (Windows)

Open git bash with admin privilege.

cd "C:/Program Files/Git/usr/share/mintty"
mkdir -p emojis
cd emojis
curl https://raw.githubusercontent.com/wiki/mintty/mintty/getemojis > getemojis
./getemojis -d

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {