Skip to content

Instantly share code, notes, and snippets.

View robertjdominguez's full-sized avatar

Rob Dominguez robertjdominguez

View GitHub Profile
@robertjdominguez
robertjdominguez / spike.ts
Created April 24, 2024 12:41
Underlying functions for crawling Learn directories.
import fs from "fs-extra";
import path from "path";
import matter from "gray-matter";
const BASE_PATH = "./sample";
// Utility function to list directories or files in a given path
async function listDirectories(parentPath: string): Promise<string[]> {
const entries = await fs.readdir(parentPath);
return entries.filter((entry) =>
#!/bin/bash
# Get 'em
projects=$(ddn get project)
# Find 'em
project_names=$(echo "$projects" | grep -E '^[|]' | awk -F'|' '{print $3}' | sed 's/ //g')
# (Duke) Nuke'em
echo "$project_names" | while read -r name; do

Model

The definition of a data model. A data model is a collection of objects of a particular type. Models can support one or more CRUD operations.

Name Type Required Description
kind string true
version string true
definition object true The definition of a data model. A data model is a collection of objects of a particular type. Models can supp
@robertjdominguez
robertjdominguez / tsc-quick.sh
Created January 22, 2024 20:18
For quickly scaffolding out a new TDD TS project.
#!/bin/bash
# Check if a project name is provided
if [ -z "$1" ]; then
echo "Please provide a project name."
exit 1
fi
PROJECT_NAME=$1
<html>
<head>
<link rel="stylesheet" href="https://bootswatch.com/4/cosmo/bootstrap.min.css">
<title>Bootstrap Day</title>
</head>
<body>
<div class="container">
@robertjdominguez
robertjdominguez / moderate.html
Created October 15, 2018 12:09
Moderate Difficulty HTML file for ECS 2018-2019
<html>
<head>
<link rel="stylesheet" href="https://bootswatch.com/4/cosmo/bootstrap.min.css">
<title>Hello World</title>
</head>
<body>
<!-- create a paragraph of 'lorem ipsum' text -->
<!-- create a list -->
@robertjdominguez
robertjdominguez / register.py
Last active June 4, 2018 22:06
Not going to give you every bit you need, but follow the pattern.
@app.route('/register', methods=['GET', 'POST'])
def register():
form = RegistrationForm(request.form)
if request.method == 'POST' and form.validate():
first_name = form.first_name.data
last_name = form.last_name.data
email = form.email.data
username = form.username.data
password = sha256_crypt.encrypt(str(form.password.data))
# Add user
# Add to imports
from flask.ext.uploads import UploadSet, configure_uploads, IMAGES
# Upload handler (put with other app configs)
photos = UploadSet('photos', IMAGES)
app.config['UPLOADED_PHOTOS_DEST'] = 'static/img' # or w/e you want to store
configure_uploads(app, photos)
# Upload logic to go under the route for uploading a file
if form.validate_on_submit():