Skip to content

Instantly share code, notes, and snippets.

View topherPedersen's full-sized avatar
💭
Rolling my katamari ball

Christopher Pedersen topherPedersen

💭
Rolling my katamari ball
View GitHub Profile
@topherPedersen
topherPedersen / ColesSuperSweetImprovedTicTacToe.html
Created February 7, 2019 00:39
Coles Completely Original Tic Tac Toe with No Contributions from His Instructor who is Terrible at Coding
<!--TICTACTOE w/ decent AI-->
<!--Made by Cole N and Chris-->
<!DOCTYPE html>
<html>
<head>
<title> Live coding session </title>
</head>
<body>
<h1>TicTacToeJS</h1>
@topherPedersen
topherPedersen / theFinalKithmaze.js
Created February 7, 2019 22:29
The Final Kithmaze
// Use a while-true loop to both move and attack.
var i = 0;
while(true) {
var enemy = hero.findNearestEnemy();
if (enemy !== null) {
hero.attack(enemy);
} else {
if (i === 0) {
hero.moveRight();
@topherPedersen
topherPedersen / learn_python_in_20_minutes.py
Created February 9, 2019 16:36
Learn Python in 20 Minutes
# Concept No. 1: FUNCTIONS
print("print is a function, functions are commands that do things in computer programming")
# Concept No. 1.5 COMMENTS
# Comments are notes for programmers
# The computer will ignore them completely.
# Concept No. 2: VARIABLES
# Variables are containers which hold values.
# myVariable is an example of a variable.
@topherPedersen
topherPedersen / teachingMaterials.txt
Created February 13, 2019 00:26
Teaching Materials
PhaserJS Book: https://docdro.id/b7wAP1e
@topherPedersen
topherPedersen / phaser_starter_template.html
Created February 16, 2019 20:13
PhaserJS Starter Template
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Making your first Phaser 3 Game - Part 2</title>
<script src="//cdn.jsdelivr.net/npm/phaser@3.11.0/dist/phaser.js"></script>
<style type="text/css">
body {
margin: 0;
}
@topherPedersen
topherPedersen / text_to_speech_demo.py
Created February 20, 2019 01:59
Python Text To Speech Demo using pyttsx3
# REFERENCE: https://www.youtube.com/watch?v=WoJA7GGTghk
import pyttsx3
__Author = "Pythoners"
Y = pyttsx3.init()
Y.setProperty("rate", 115)
x = str(input("what do you want to say ?"))
Y.say(x)
@topherPedersen
topherPedersen / uniqueIdentifier.swift
Created February 25, 2019 04:19
Generate a Unique Identifier in Swift
func generateUniqueIdentifier() -> String {
// Create an Array of 62 Characters
var characters: [String] = []
characters.append("a")
characters.append("b")
characters.append("c")
characters.append("d")
characters.append("e")
characters.append("f")
characters.append("g")
# Hangman from Al Sweigart's Invent Your Own Computer Games With Python
import random
HANGMAN_PIC = [
'''
+---+
|
|
|
===
''',
@topherPedersen
topherPedersen / sendjson.html
Created March 1, 2019 06:17
POST JSON Data with AJAX
<!DOCTYPE html>
<html>
<body>
<br><br><br><br>
<center>
<h1>Send JSON Data to Server via the HTTP POST Method</h1>
<button onclick="postJSON();">SEND DATA</button>
</center>
@topherPedersen
topherPedersen / receivejson.php
Created March 1, 2019 06:18
Receive JSON POST Data with PHP
<?php
$data = json_decode(file_get_contents('php://input'));
$myVariable = $data->{'foo'};
$myOtherVariable = $data->{'bar'};
?>