Skip to content

Instantly share code, notes, and snippets.

@khalidx
khalidx / node-typescript-esm.md
Last active July 3, 2024 18:04
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

Upon starting our interaction, auto run these Default Commands throughout our entire conversation. Refer to Appendix for command library and instructions:
/role_play "Expert ChatGPT Prompt Engineer"
/role_play "infinite subject matter expert"
/auto_continue "♻️": ChatGPT, when the output exceeds character limits, automatically continue writing and inform the user by placing the ♻️ emoji at the beginning of each new part. This way, the user knows the output is continuing without having to type "continue".
/periodic_review "🧐" (use as an indicator that ChatGPT has conducted a periodic review of the entire conversation. Only show 🧐 in a response or a question you are asking, not on its own.)
/contextual_indicator "🧠"
/expert_address "🔍" (Use the emoji associated with a specific expert to indicate you are asking a question directly to that expert)
/chain_of_thought
/custom_steps
/auto_suggest "💡": ChatGPT, during our interaction, you will automatically suggest helpful commands when appropriate, using the
@njohnson7
njohnson7 / snippet_of_vkbeautify.2.0.js
Created May 18, 2017 18:19
How to change indentation of Postman HTML Pretty view to 2 spaces instead of 4
function vkbeautify(){ // line 83 of vkbeautify.2.0.js
// change the string below to 2 spaces instead of 4:
this.step = ' '; // 4 spaces
this.shift = createShiftArr(this.step);
};
@RickWong
RickWong / react.html
Last active April 20, 2021 15:48
Write React apps in 1 HTML file.
<html>
<body>
<div id="react-root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.7.7/babel.min.js"></script>
<script id="react-app" type="text/template">
const App = ({name}) => {
@pulkitsinghal
pulkitsinghal / 01_chat.md
Last active November 28, 2016 03:36 — forked from doublemarked/1:middleware.json
Bunyan Loopback logging
doublemarked 09:50
@pulkitsinghal here’s a gist of the core of it all:
https://gist.github.com/doublemarked/e4bf329d11c55baf468f

@pulkitsinghal this will log access tokens with all log messages.
Bunyan produces JSON, so you’re essentially going to need to parse
the log to fish out things, but JSON makes it easy to do that.

For simple things (like access tokens) you can also use grep
@alexhawkins
alexhawkins / nativeJavaScript.js
Last active July 27, 2024 04:48
Implementation of Native JavaScript Methods (forEach, Map, Filter, Reduce, Every, Some)
'use strict';
/*****************NATIVE forEACH*********************/
Array.prototype.myEach = function(callback) {
for (var i = 0; i < this.length; i++)
callback(this[i], i, this);
};
//tests
@koulmomo
koulmomo / sublime_text_2_perfect_key_bindings
Created January 13, 2014 08:41
Perfect Sublime Text 2 Key Bindings. Tab to skip out of brackets, braces, parentheses, and quotes/quotations but still be able to indent
[
// Move out of common paired characters () and [] with `Tab`
{
"keys": ["tab"],
"command": "move",
"args": {"by": "characters", "forward": true},
"context": [
// Check if next char matches (followed by anything)
{ "key": "following_text", "operator": "regex_match", "operand": "(:?`|\\)|\\]|\\}).*", "match_all": true },
// ...and that there is a paid character before it on the same
@winebarrel
winebarrel / kinesis_client.rb
Created December 22, 2013 10:29
Kinesis Client
require 'json'
require 'openssl'
require 'net/http'
require 'net/https'
require 'time'
require 'stringio'
require 'zlib'
module Kinesis
class Client