Skip to content

Instantly share code, notes, and snippets.

View rob-kistner's full-sized avatar

Rob Kistner rob-kistner

  • The Vomela Companies
  • Chicago, IL
View GitHub Profile
@rob-kistner
rob-kistner / box-borders.css
Last active October 10, 2020 01:36
Various CSS
/*
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) {
@rob-kistner
rob-kistner / .gitignore
Last active October 5, 2020 19:15
Django - Projects
*.log
*.pot
*.pyc
db.sqlite3
__pycache__/
node_modules/
.env
venv/
@rob-kistner
rob-kistner / crud_operations.py
Last active October 4, 2020 15:10
Django - ORM
# 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)
@rob-kistner
rob-kistner / settings-mysql.py
Last active October 4, 2020 14:54
Django - DB Settings
#
# Required:
# pip3 install mysqlclient
#
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'dbname',
'USER': 'username',
'PASSWORD': 'password',
@rob-kistner
rob-kistner / _variables_v5.scss
Created June 17, 2020 23:07
Bootstrap Variables
// 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;
@rob-kistner
rob-kistner / domTools.js
Last active July 7, 2021 19:19
Javascript Utilities
/* ----------------------------------------
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
@rob-kistner
rob-kistner / debounce.js
Last active April 19, 2020 20:05
Debounce for Vue
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);
};
@rob-kistner
rob-kistner / all.js
Last active October 9, 2020 01:23
Useful Javascript Snippets
/* -----------------------------------------
EXAMPLES:
all([4, 2, 3], x => x > 1); // true
all([1, 2, 3]); // true
------------------------------------------*/
const all = (arr, fn = Boolean) => arr.every(fn)
@rob-kistner
rob-kistner / README.md
Last active October 9, 2020 01:24
Boilerplate - Nunjucks

Nunjucks Boilerplate

For quick-starting a standard website nunjucks project.

Folder Hierarchy

.
├── html                        # Holds nunjucks templates with both `.html` and `.njk` extensions
│ ├── _layouts # Template folder, for `extends`
@rob-kistner
rob-kistner / gulpfile.js
Last active February 11, 2020 01:50
Gulp v4 build, LESS
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()