This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add this as a singleton and access functions using | |
# util.<function_name> | |
extends Node | |
# choose a random item from an array | |
static func rand_choice(list): | |
return list[randi() % list.size()] | |
# choose a random integer in range (start, end-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Rigidbody Controller for basic 3D movement | |
extends RigidBody | |
# not sure what to put here to get proper turning | |
var turn_speed = Vector3(1,0,0) | |
# not sure what to put here to get proper movement | |
var movement_speed = Vector3(1,0,0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader_type canvas_item; | |
/** | |
Maps object texture onto a sphere and applies a spherical normal | |
based on a simulated light. | |
Adapted from | |
https://www.raywenderlich.com/2323-opengl-es-pixel-shaders-tutorial | |
and | |
https://gamedev.stackexchange.com/a/9385 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, bs4 | |
import time | |
# for n in range(0, 5937): | |
# url = 'https://www.fiercebiotech.com/biotech?page=0%2C' + str(n) | |
# data = requests.get(url) | |
# use this to prevent ddos | |
# time.sleep(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://nssdc.gsfc.nasa.gov/planetary/factsheet/ | |
import turtle | |
import math | |
turtle.bgcolor("black") | |
G = 6.67428e-11 | |
AU = 149.6e9 # m | |
SCALE = 250 / (2 * AU) # pixels/AU | |
TIMESTEP = 24 * 3600 # s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
return "Hello world!" | |
@app.route("/goodbye") | |
def bye(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Cats</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<h1>Learn about cats!</h1> | |
<h2>Section 1</h2> | |
<p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <cs50.h> | |
#include <time.h> | |
#define DECK_SIZE 52 | |
// strings for pretty printing values | |
string ranks[14] = {"", "Ace", "Two", "Three", "Four", "Five", "Six", | |
"Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Every GIF must have this first 6 bytes | |
char *gif_header = "GIF89a"; | |
int main(int argc, char *argv[]) | |
{ | |
// check for correct number of arguments | |
if (argc != 2) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code in the setup section runs once | |
void setup() | |
{ | |
for (int x = 1; x < 5; x++) | |
{ | |
pinMode(x, OUTPUT); | |
} | |
} | |
// Code in the loop section repeats |