Skip to content

Instantly share code, notes, and snippets.

View johnsogg's full-sized avatar

Gabe Johnson johnsogg

View GitHub Profile
@johnsogg
johnsogg / c++.md
Last active January 11, 2024 02:14
C++ Crash Course

C++ Crash Course

If you're new to the command line please see the CLI crash course first. Similarly, there's a Git crash course also.

This crash course is aimed at my Data Structures students in CS 2270 at CU-Boulder. Others might find it useful, though this is hardly the only "how to c++" thing on the web. This is tailored for the particular workflow in our course.

Specific Advice for 2270 Students

The general workflow for 2270 homework assignments is:

@johnsogg
johnsogg / git.md
Last active June 7, 2024 15:56
Git and GitHub Crash Course

Git and GitHub Crash Course

This crash course is meant for my CS 2270 students at CU-Boulder. It might be helpful for others, but there might be course-specific content in here. The internet has goo-gobs of tutorials for git. Students: you should totally check those out! I'm making this as a sort of one-stop-shop for your 2270 needs. If you need advanced documentation, the git website has more than you could ever want.

If you've not familiar with command line interfaces, you might want to read the command line interface crash course to help you understand this.

Git is an open source source code management tool, and it is easily the most widely used tool in its category. GitHub is a company that provides git-related services, including repository hosting, user and team management, security, and collaboration interfaces. Git exists independently of GitHub. There are other systems like GitHub such as Gitlab, Bit

@johnsogg
johnsogg / cli.md
Last active August 29, 2024 01:25
Command Line Interface crash course

Command Line Crash Course

I'm writing this for my 2270 Data Structures students, though I bet others will find it helpful too.

You might be using a command line for the first time, and if that's true, you're certainly using Git on the command line for the first time. It can be daunting, but don't sweat it.

A command line interface (CLI) is based on a textual back-and-forth. You type a command, and if the CLI can understand it, it will run some code and maybe give you a response. In this sense, working with a CLI is like working with a programming language. You have to use the right syntax.

The syntax and behavior depends on which particular CLI you're using. A CLI is typically powered by a program called a Shell, and for our purposes we can use the terms CLI and Shell interchangeably. macOS now ships with zsh as the default; many Linux and older Macs tend to use either the Bourne shell (sh) or the Bourne Again shell (bash). Windows also has its default command line (which I know nothing about) and

@johnsogg
johnsogg / main.dart
Last active February 16, 2021 23:50
Dart Regular Expressions
void main() {
final pattern = RegExp('^[-\.\' \"’a-zA-Z]+\$');
final inputs = [
"Sting",
"John Lennon",
"Miles O'Brian",
"Miles O’Brian",
"Alexandria Ocasio-Cortez",
"J.P. Morgan",
// id_map.ts
//
// Convert an array of objects T that have a string ID to a
// Record<string, T>.
export type Identifiable = {
id: string;
};
export type IDMap<T> = {
package-lock.json$
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johnsogg
johnsogg / dataTable.tsx
Last active October 1, 2018 17:04
Material Design: How to maintain both type safety and styling with generic components
class DataTable<T> extends React.PureComponent<Props<T>, State> {
// nothing special about the implementation of DataTable. Just keep it
// unexported, because it will be exposed via the Wrapped thing below.
}
// If you have a component that takes type parameters and need to use 'withStyles', here is a
// way to maintain type safety:
//
// DataTable: Our custom component to wrap.
// T: Type parameter for DataTable
@johnsogg
johnsogg / tableThing.tsx
Created September 27, 2018 19:52
Typescript example of material-ui Table component
import {
createStyles,
Paper,
Table,
TableBody,
TableCell,
TableHead,
TableRow,
Theme,
withStyles,
@johnsogg
johnsogg / map4.svg
Last active September 24, 2018 02:57
map4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.