For quick-starting a standard website nunjucks project.
.
├── html # Holds nunjucks templates with both `.html` and `.njk` extensions
│ ├── _layouts # Template folder, for `extends`
/* | |
CSS Box Borders | |
Borders will thicken the interior of containers by default. This means, in a case where there are more than one column next to each other, the containers meet will be double thickness. You can make them single thickness by removing the right border on all neighboring containers except the last one with `:not(:last-child)`. | |
*/ | |
.col { | |
border: solid 5px red; | |
} | |
.col:not(:last-child) { |
*.log | |
*.pot | |
*.pyc | |
db.sqlite3 | |
__pycache__/ | |
node_modules/ | |
.env | |
venv/ |
# Common CRUD Operations using Django | |
# ---------------------------------------- | |
# in an app's models.py… | |
from django.db import models | |
class Person(models.Model): | |
first_name = models.CharField(max_length=100) |
# | |
# Required: | |
# pip3 install mysqlclient | |
# | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'dbname', | |
'USER': 'username', | |
'PASSWORD': 'password', |
// Variables | |
// | |
// Variables should follow the `$component-state-property-size` formula for | |
// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs. | |
// Color system | |
$white: #fff !default; | |
$gray-100: #f8f9fa !default; | |
$gray-200: #e9ecef !default; |
/* ---------------------------------------- | |
domTools.js | |
A number of wrapper and shortcut functions | |
meant to imitate features of jquery and | |
otherwise simplifying their vanilla js counterparts | |
without the jquery overhead. | |
---------------------------------------- */ | |
// aliases |
export function debounce(fn, delay) { | |
let timeoutID = null; | |
return function() { | |
clearTimeout(timeoutID); | |
const args = arguments; | |
const _this = this; | |
timeoutID = setTimeout(function() { | |
fn.apply(_this, args); | |
}, delay); | |
}; |
/* ----------------------------------------- | |
EXAMPLES: | |
all([4, 2, 3], x => x > 1); // true | |
all([1, 2, 3]); // true | |
------------------------------------------*/ | |
const all = (arr, fn = Boolean) => arr.every(fn) |
const { src, dest, watch, parallel, series, done } = require('gulp'), | |
gulpif = require('gulp-if'), | |
del = require('del'), | |
path = require('path'), | |
autoprefixer = require('gulp-autoprefixer'), | |
less = require('gulp-less'), | |
cleancss = require('gulp-clean-css'), | |
uglify = require('gulp-uglify'), | |
concat = require('gulp-concat'), | |
browserSync = require('browser-sync').create() |