Skip to content

Instantly share code, notes, and snippets.

View setkyar's full-sized avatar
🧘‍♂️

Set Kyar Wa Lar (Universe) setkyar

🧘‍♂️
View GitHub Profile
@Gaelan
Gaelan / README.md
Last active August 29, 2023 04:13
ChatGPT passes the 2022 APCSA free response section

ChatGPT passes the 2022 AP Computer Science A free response section

For fun, I had ChatGPT take the free response section of the 2022 AP Computer Science A exam. (The exam also has a multiple-choice section, but the College Board doesn't publish this.) It scored 32/36.

Methodology

  • For each question, I pasted in the full text of the question and took the response given.
  • I tried each question once and took the response given: no cherry-picking. For readability, I've added indentation in some cases, and included method signatures where they were provided in the question and ChatGPT only provided a body. I've added question numbers; any other comments are ChatGPT's.
  • Many questions have examples containing tables or diagrams; because those don't translate well to plain text, I excluded those tables/diagrams and any text that referenced them.
  • I excluded the initial instructions at the top of th
@ityonemo
ityonemo / test.md
Last active April 7, 2024 14:48
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@f13end
f13end / Wallet Addresses
Last active March 19, 2023 19:01
List of addresses for major bitcoin and ethereum exchanges
1.Binance
2.Bitfinex
3.Huobi
4.Bitstamp
5.Coincheck
6.Kraken
7.Poloniex
8.Gate.io (Only ETH)
9.Cryptopia (Only ETH)
10.Gemini (Only ETH)
@Spittal
Spittal / docker-compose.yaml
Created September 15, 2018 02:43
Docker compose file from SBVR
version: '3'
services:
fpm:
image: sbvr/laravel-fpm:2.1.2
volumes:
- app:/var/www
networks:
- appnet
worker:
Dependences:
sudo apt-get update
sudo apt-get install build-essential
apt-get install python-dev
sudo pip install -U setuptools
Steps:
download from https://mrjbq7.github.io/ta-lib/install.html
@Atinux
Atinux / async-foreach.js
Last active October 10, 2023 03:04
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@lestrrat
lestrrat / stages.md
Last active May 18, 2022 02:19
Seven Stages of Becoming a Go Programmer
  • stage 1: You believe you can make Go do object oriented programming. You want to do this by using clever struct embedding.
  • stage 2: You believe goroutines will solve all of your problems. You want to use goroutines for anything and everything that you can, who cares if the code becomes a bit more complicated
  • stage 3: You believe that instead of object oriented programming, interfaces will solve all of your problems. You want to define everything in terms of interfaces
  • stage 4: You believe channels will solve all of your problems. You want to do everything from synchronization, returning values, and flow control using channels.
  • stage 5: You now believe Go is not as powerful as people claim it to be. You feel like you're stripped of all of the nice tools and constructs that other languages provide.
  • stage 6: You realize that stages 1~5 were all just your imagination. You just didn't want to accept the Go way. Everything starts to make sense.
  • stage 7: You are now at peace