Skip to content

Instantly share code, notes, and snippets.

View CodeByLine's full-sized avatar

Yumei Leventhal CodeByLine

View GitHub Profile
const SECRET_KEY = ENTER YOUR SECRET KEY HERE;
const MAX_TOKENS = 200;
// For more cool AI snippets and demos, follow me on Twitter: https://twitter.com/_abi_
/**
* Completes your prompt with GPT-3
*
* @param {string} prompt Prompt
* @param {number} temperature (Optional) Temperature. 1 is super creative while 0 is very exact and precise. Defaults to 0.4.
@CodeByLine
CodeByLine / django_deploy.md
Created December 11, 2020 06:02 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@bradtraversy
bradtraversy / django_deploy.md
Last active July 2, 2024 19:39
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@bradtraversy
bradtraversy / django_cheat_sheet.md
Last active July 2, 2024 19:38
Django command cheat sheet

Django 2.x Cheat Sheet

Creating a virtual environment

We need to create a virtual env for our app to run in: More Here Run this command in whatever folder you want to create your venv folder

python -m venv ./venv
@gaearon
gaearon / modern_js.md
Last active June 11, 2024 07:33
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@wynand1004
wynand1004 / star_trek_captains.py
Created December 4, 2017 01:34
A simple introduction / practice exercise to learn a little about Python lists.
import os
os.system("clear")
print("""
__ ___
(_ |_ _ _ | _ _|
__)|_(_|| || (-|(
""")
# 1) Create a list called captains and add the following names to it:
@wynand1004
wynand1004 / python_function_practice.py
Created November 8, 2017 05:07
Python Function Practice (Send and Return Values w/Booleans)
# Function Practice Send and Return Values w/Booleans
# Please create and call various functions as explained below.
import os
os.system("clear")
# 1
# Write a function that prints Doh! on the screen.
# Call the function print_doh
print("1\n")
def print_doh():
@wynand1004
wynand1004 / rock_paper_scissors.py
Last active December 30, 2017 03:49
Basic Rock Paper Scissors Program (No Loop)
#Janken with Loop Assignment Example by Christian Thompson
#Uses Random numbers 1-3 to represent Rock, Paper, Scissors
#Initialize
import os
import random
import time
#Declare variables
@wynand1004
wynand1004 / RPS_ASCII_Art.py
Created October 15, 2017 04:05
Rock, Paper, Scissors ASCII Art
# Rock Paper Scissors ASCII Art
# Rock
print("""
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
@wynand1004
wynand1004 / top_secret_decoder.py
Created October 10, 2017 00:05
Top Secret Decoder Practice
# Top secret decoder
# The CIA has discovered a plot against a major city
# SIGINT has intercepted a message with the location and date of the attack
# Unfortunately, the message is encoded.
# Due to your awesome Python skills, you have been hired to decode the message
# A double agent has provided the encoding scheme which is as follows:
# All numbers need to be changed to spaces
# All capital letters should be changed to *
# The lowercase letter q is equal to \n
# All other lowercase letters should be ignored.