Skip to content

Instantly share code, notes, and snippets.

@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active July 24, 2024 12:04
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active July 19, 2024 06:35
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@praveen001
praveen001 / message.go
Last active May 7, 2023 04:08
Serverless WebSockets with API Gateway and Golang Lambda
type MessageAction struct {
Type string `json:"type"`
Payload MessagePayload `json:"payload"`
}
// MessagePayload ..
type MessagePayload struct {
Message MessageWithInfo `json:"message"`
}
@baptx
baptx / instagram-api_direct_messages_backup.js
Last active July 4, 2024 13:53
Instagram API: view and backup direct messages from a web browser
/*
Instagram API: view and backup direct messages from a web browser
Since April 2020, Instagram has a web version to send and read direct messages so my Instagram scripts are not longer needed and I would not recommend using them unless you really need it, to avoid being banned
(never happened to me with Instagram but WhatsApp is owned by Facebook also and they did it to users registering from an unofficial app like yowsup: https://github.com/tgalal/yowsup/commit/88b8ad9581fa22dac330ee3a05fec4e485dfa634#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5)
1) Log in on Instagram web version and go to your profile page
(the home page will not work because it loads data when scrolling down and the direct messages will be displayed at the bottom of the page)
2) Modify HTTP headers with a browser addon like Header Editor (https://addons.mozilla.org/en-US/firefox/addon/header-editor/)
@bmaupin
bmaupin / free-database-hosting.md
Last active July 28, 2024 13:31
Free database hosting
@beesandbombs
beesandbombs / rgbRings.pde
Created January 30, 2019 16:56
RGB rings
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
@arpit
arpit / cryptokitties.sol
Created January 23, 2018 21:33
Cryptokitties Contract from the Eth blockchain
pragma solidity ^0.4.11;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
@threepointone
threepointone / 0 basics.md
Last active March 21, 2023 01:53
css-in-js

A series of posts on css-in-js

0. styles as objects

First, an exercise. Can we represent all of css with plain data? Let's try.

let redText = { color: 'red' };
@francisrod01
francisrod01 / access.log
Last active March 26, 2019 13:20
AWS Beanstalk SSL and renewal with Let's Encrypt Free SSL
172.31.43.189 - - [13/Jan/2018:03:01:56 +0000] "GET / HTTP/1.1" 404 139 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36" "191.37.20.2"
172.31.43.189 - - [13/Jan/2018:03:02:03 +0000] "GET / HTTP/1.1" 404 139 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 OPR/50.0.2762.58" "191.37.20.2"
172.31.20.92 - - [13/Jan/2018:03:07:10 +0000] "GET /.well-known/acme-challenge/<my-key-here> HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" "52.29.173.72"
172.31.20.92 - - [13/Jan/2018:03:07:10 +0000] "GET /.well-known/acme-challenge/<my-key-here> HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation server; +https://www.letsencrypt.org)" "34.213.106.112"
172.31.43.189 - - [13/Jan/2018:03:07:10 +0000] "GET /.well-known/acme-challenge/<my-key-here> HTTP/1.1" 301 185 "-" "Mozilla/5.0 (compatible; Let's Encrypt validation se