Skip to content

Instantly share code, notes, and snippets.

View jsheridanwells's full-sized avatar

Jeremy Wells jsheridanwells

View GitHub Profile
@jsheridanwells
jsheridanwells / ng-conditional-content-projection-example.ts
Last active January 23, 2022 20:10
An example of Angular content projection. I was following this: https://angular.io/guide/content-projection#conditional-content-projection, but couldn't get it right away
import { Component, ContentChild, Directive, Input, OnInit, TemplateRef } from '@angular/core';
// parent component where the list is rendered and where we can decide where which conditional field will be rendered
@Component({
selector: 'app-root',
template: `
<h2>Here's where the chips come in yo</h2>
<div *ngFor="let c of config">
<app-chip [hasConditionalField]="c.hasConditionalField">
<ng-template appConditionalField>
@jsheridanwells
jsheridanwells / docker-compose-mongo.yaml
Created February 19, 2021 15:28
Docker Compose for running MongoDB on localhost
version: "3"
services:
mongodb:
container_name: mean_urls_db
image: mongo:latest
volumes:
- ./scripts/mongo/init/:/docker-entrypoint-initdb.d
- ./scripts/mongo/init:/home/mongodb
- ./scripts/mongo/seed/:/home/mongodb/seed
- mean_urls_data:/data/db
@jsheridanwells
jsheridanwells / Dockerfile
Last active September 1, 2020 14:14
More or less the default Dockerfile that comes from the VS 2019 template
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
# See Also: https://docker-curriculum.com/#sf-food-trucks
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["AspNetCoreConfigExample.csproj", ""]
using System;
using System.Net;
namespace WeatherWalkingSkeleton.Infrastructure
{
public class OpenWeatherException : Exception
{
public HttpStatusCode StatusCode { get; }
public OpenWeatherException() { }
@jsheridanwells
jsheridanwells / 01.cs
Created June 18, 2020 16:38
weather-walking-skeleton-part_1
namespace WeatherWalkingSkeleton.Config
{
public class OpenWeather
{
public string ApiKey { get; set; }
}
}
@jsheridanwells
jsheridanwells / 01.sh
Created June 2, 2020 19:50
weather-walking-skeleton-part_0
# bash
$ dotnet new webapi -o WeatherWalkingSkeleton
@jsheridanwells
jsheridanwells / 01.sh
Last active May 31, 2020 17:22
A dive into D3
# bash
$ echo 'export const apiKey = "<YOUR OPEN WEATHER MAP API KEY>";' >> javascripts/apiKey.js
@jsheridanwells
jsheridanwells / Blueprints.md
Last active April 3, 2024 19:10
From Zero to Flask Notes

Blueprints

A typical setup:

app_dir/
  manage.py
  application.py
  module_dir/
    views.py
@jsheridanwells
jsheridanwells / Json-Server-w-Auth-SETUP.md
Last active January 29, 2019 16:45
Using Json-Server with JWT
  1. Create public and private RSA keys (public.key, private.key). Generate them here.
  2. npm install --save-dev jsonwebtokens json-server faker
  3. create users.json with at least email and password for a fake user.
  4. Add these to package.json (assumes code is in a directory called api):
    "api-noAuth": "node_modules/.bin/json-server api/seed.js",
    "api-auth": "node ./api/server.js",
    "api-seed": "node ./api/seed.js > api/db.json"
  1. npm run api-seed will create db.json, npm run api-noAuth is just the api npm run api-auth will create and require tokens.
@jsheridanwells
jsheridanwells / .bashrc
Last active November 11, 2018 17:01
BashRC and ZshRC Sync
# GENERAL
alias c='clear'
alias ca='clear &&'
alias la='ls -la'
# GIT ALIASES
alias g='git'
alias gs='git status'
alias ga='git add'