Skip to content

Instantly share code, notes, and snippets.

View bartdorsey's full-sized avatar

Bart Dorsey bartdorsey

View GitHub Profile
@bartdorsey
bartdorsey / asyncErrorHandler.js
Last active January 27, 2022 23:37
asyncErrorHandler.js
// This is a higher order function that takes in an express handler function callback
// and returns a new one that does a try catch on your handler so you don't have
// to put a try catch in every route.
function asyncErrorHandler(callback) {
return async function (req, res, next) {
try {
return callback(req, res, next)
} catch (error) {
next(error)
}
@bartdorsey
bartdorsey / quote.js
Created February 28, 2022 15:42
Random Quote Node Script
#!/usr/bin/env node
const http = require('http');
const options = {
hostname: "programming-quotes-api.herokuapp.com",
path: "/quotes/random",
method: 'GET'
}
const req = http.request(options, (res) => {
@bartdorsey
bartdorsey / realm-notes.md
Last active March 18, 2022 15:01
Realm Notes

Realm Notes

POIs

  • Spawn Base
    • 9, 34
  • Spawn Village
    • 118, 85
  • Mountain with some Iron on top
  • 598, -204
@bartdorsey
bartdorsey / TodoItemUpdateView.md
Created May 5, 2022 00:36
TodoItemUpdateView

TodoItemUpdateView

classDiagram
  class BaseUpdateView {
    object
    get(request)
    post(request)
  }
@bartdorsey
bartdorsey / django-model-creation-cheatsheet.md
Last active June 2, 2022 17:35
Django Model Creation Cheatsheet

Django Model Creation Cheatsheet

Add the model class to models.py

class MyModel(models.Model):
  pass

Add fields to your model

@bartdorsey
bartdorsey / echobucket-minecraft-mod-guide.md
Last active June 7, 2022 13:42
echobucket's Minecraft Java Mod Guide

echobucket's Minecraft Java Mod Guide

A note on download mods and malware

There are tons of mod sites on the internet, a lot of them link to sites that are questionable. Be careful what you download and run on your computer. My suggesting is to stick to official sites for mods or places like Curseforge.

The Launcher

I use multimc to launch minecraft. It's possible to use the official launcher with all the mods below, but I vastly prefer the utility this launcher give you.

@bartdorsey
bartdorsey / common-django-pitfalls.md
Last active May 30, 2024 17:38
Common Django Pitfalls

Common Django Pitfalls

This contains a collection of common errors people make when coding Django apps, and how to fix them.

Important Strategies for preventing pitfalls

  1. Always do one thing at a time and test it. Make a single change, test it for errors, before moving on to the next thing.
  2. When trying to fix an error, only change one thing at a time, If the error message does not change, undo that change and try something else.
  3. If you discover you haven't saved a file, and that's causing an error, save the file and try again and pay attention to any new errors. The original error isn't worth worrying about until you have saved everything
@bartdorsey
bartdorsey / git-worktrees-how-to.md
Last active September 16, 2022 15:24
How I use git worktrees

How I use git worktrees

What are git worktrees?

Git worktrees are a special feature of git that lets you checkout branches/commits into a folder.

How is this different that plain 'ol git checkout?

You can check each branch out into a separate folder. This means no more stashing/un-stashing or committing just to work on several branches at once.

@bartdorsey
bartdorsey / notable-minecraft-seeds.md
Last active July 29, 2022 15:15
Notable Minecraft Seeds
Seed Variant Description
13032936 Bedrock lots of biomes all around, with a savannah village close by
-4643289498761436768 Bedrock Jungle with Portal and Cave near Spawn
@bartdorsey
bartdorsey / how-to-start-a-git-bases-project.md
Last active September 16, 2022 15:24
How to start a git based project

How to start a git-based project

If you already have a remote repository on gitlab or github

You will gather the "clone url" from the website and then use the following command.

git clone <clone url>