Skip to content

Instantly share code, notes, and snippets.

View stungeye's full-sized avatar

Kyle Geske stungeye

View GitHub Profile
@stungeye
stungeye / code_of_conduct.md
Last active July 19, 2022 18:39
Sound + Code = Jam 🎶 Code of Conduct

Why Have a Code of Conduct?

We want all attendees to be able to focus their full attention on learning and creating at this event. This is impossible to do if you are being harassed or discriminated against. Accordingly, all attendees are expected to show respect and courtesy to each other in all interactions.

To make sure that everyone has a common understanding of “show respect and courtesy to each other,” we have adopted the following code of conduct.

Sound + Code = Jam 🎶 Code of Conduct

The Sound + Code = Jam event is committed to providing a friendly, safe and welcoming environment for all, regardless of gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or another similar characteristic.

@stungeye
stungeye / header.h
Created April 12, 2022 16:03
Shape and Derived Shapes
// Define a new class called Shape
//
// Properties of Shape:
// - color (ofColor) // ofColor::cadetBlue
// - position (glm::vec2) // {0, 0}
//
// Constructor that takes in a ofColor and a glm::vec2
// and uses those parameters to initial the properties.
//
@stungeye
stungeye / main.cpp
Created April 5, 2022 15:24
Base and Derived Classes and Objects in C++ (With References and Pointers)
#include <iostream>
#include <string>
class Base {
protected:
int value{0};
public:
Base(int value) : value{value} {
std::cout << "Base Constructor\n";
}
@stungeye
stungeye / main_with_pointer.cpp
Last active February 13, 2023 18:23
Has-As Class Relationship with and without Pointers
/*
Imagine this code was written before initializer lists. (Pre C++11)
When compared with `main_without_pointer_oldskool_and_broken.cpp`:
- Point's location member is a pointer to a Location.
- Location does not need a default constructor.
- The location member is only constructed once.
*/
#include <iostream>
@stungeye
stungeye / instructions.md
Created February 4, 2022 04:35
Getting Started with Eleventy using WSL 2

Getting Started with Eleventy using WSL 2

  1. Install WSL and enable WSL2.
  2. Ensure everything is up to date from the WSL prompt:
    sudo apt update 
    sudo apt upgrade
    sudo apt install build-essential
    
  3. Install Node: curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash
@stungeye
stungeye / lambda.cpp
Created January 27, 2022 21:32
Lambdas in C++
#include <iostream> // std::cout
#include <string> // std::string
#include <vector> // std::vector
#include <algorithm> // std::count_if, std::adjacent_find, std::sort
#include <numeric> // std::accumulate
#include <functional> // std::function
#include <array> // std::array
void printIt(const std::function<int(const std::string& word)>& fnc, const std::string& word) {
std::cout << fnc(word) << "\n";
@stungeye
stungeye / binary_files.cpp
Created January 20, 2022 20:07
Reading and Writing Strings From a Binary File
// ExploringFiles.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <filesystem>
#include <fstream>
#include <vector>
#include <string>
@stungeye
stungeye / money.cpp
Created January 18, 2022 15:53
Money Class
class Money{
static constexpr int centsPerDollar{100};
int mDollars{0};
int mCents{0};
// Ensure that we never have more than 99 cents.
void rollCentsIntoDollars() {
int additionalDollars = mCents / Money::centsPerDollar;
mDollars += additionalDollars;
mCents %= Money::centsPerDollar;
#include <iostream>
#include <filesystem>
#include <fstream>
#include <vector>
int main() {
std::cout << "CWD: " << std::filesystem::current_path() << "\n";
std::ifstream inputFile{"data.txt"};
@stungeye
stungeye / code_words.txt
Created January 6, 2022 22:39
Doorman's File
1-3 a: abcde
1-3 b: cdefg
2-9 c: ccccccccc
1-8 n: dpwpmhknmnlglhjtrbpx
11-12 n: frpknnndpntnncnnnnn
4-8 t: tmttdtnttkr
12-18 v: vvvvvvvqvvvvvqvvgf
3-4 c: cccc
17-18 z: zzzzzzzzdzzzzzzgzr
5-6 l: llltzl