Skip to content

Instantly share code, notes, and snippets.

View amygori's full-sized avatar
🌈
🥑 ✨ 🌈 ✨ 🥑

Amy Gori amygori

🌈
🥑 ✨ 🌈 ✨ 🥑
View GitHub Profile
@amygori
amygori / add_superuser.py
Created November 30, 2022 19:23
Management command for creating a superuser in Django
import random
from django.contrib.auth.hashers import make_password
from django.core.management.base import BaseCommand, CommandError
from api.models import Book, User, BookRecord
from library import settings
# To run this management command:
@amygori
amygori / python_exercism.md
Created October 19, 2021 15:23
exercism.io URLs example

Intro JS: functions

Create a javascript file and link it to an html page so that you can run these functions in the console.

  1. Write a function that takes a single argument and then logs that argument to the console.

  2. Write a function called sum with two parameters that returns the sum of those 2 numbers.

  3. Write a function called getLength that takes one argument (a string) and returns its length

// Intro JS: if/else
// 1. What will be logged to the console when the statement below runs?
let x;
if (x) {
console.log("True!");
} else {
console.log("False!");
}
.yellow {
background-color: #f4bf75;
}
.teal {
background-color: #068D9D;
}
.lilac {
background-color: #817E9F;
}
.teal-2 {

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).