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 / array-every.js
Last active May 4, 2020 05:37
Javascript Array Functions
const times = [
{ start: "09:00", end: "10:00", hours: 1 },
{ start: "10:00", end: "11:30", hours: 1.5 },
{ start: "11:30", end: "12:00", hours: 0.5 },
{ start: "13:30", end: "15:45", hours: 2.25 },
{ start: "15:45", end: "16:45", hours: 1 }
];
const allOverOne = times.every( entry => entry.hours >= 1 );
@rob-kistner
rob-kistner / findInJSON.js
Last active May 1, 2019 02:41
Find in JSON
const data = [
{ "id": "1", "firstname": "Friendly", "lastname": "Glenn" },
{ "id": "5", "firstname": "Ifits", "lastname": "Friendly" },
{ "id": "24", "firstname": "Mya", "lastname": "Crotch" },
{ "id": "81", "firstname": "Glenn", "lastname": "Tipton" },
{ "id": "23", "firstname": "Friendly", "lastname": "Dude" },
];
/* -----------------------------------------
Object extension:
@rob-kistner
rob-kistner / absolute-center.css
Last active March 22, 2018 14:24
Absolute centering of an object on the page using flexbox
.totalcenter {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
height: 100vh;
}
// SCSS Spacing Helpers
//
// update 060519
// @rob.kistner
//
// based on Bootstrap 4's spacing helpers utilities
//
$spacer: 1rem;
$spacers: (
@rob-kistner
rob-kistner / spacing-helpers.css
Last active February 16, 2019 05:48
Spacing helpers numbered, based on Bootstrap's utility spacer classes
/* -----------------------------------------
Spacing Helpers
------------------------------------------*/
/* margin */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mr-0 { margin-right: 0; }
.mb-0 { margin-bottom: 0; }
@rob-kistner
rob-kistner / bs4-alerts-html.code-snippets
Last active October 28, 2020 15:41
Visual Studio Code Snippets
/* ----------------------------------------
Bootstrap 4
HTML, PHP, BLADE snippets
Alerts
042419
---------------------------------------- */
{
"Boostrap 4: Alert": {
@rob-kistner
rob-kistner / printutils.py
Last active July 27, 2020 17:38
Python Utilities
#
# printutils
#
# A collection of print utilties to use
# when testing python scripts or following
# along with code-along tutorials.
#
import json # for json.dumps()
import termcolor as tc # colorize banner output, etc.
@rob-kistner
rob-kistner / gulpfile.js
Last active September 18, 2024 13:25
Gulp v4 build, SCSS
const { src, dest, watch, parallel, series, done } = require('gulp'),
gulpif = require('gulp-if'),
del = require('del'),
autoprefixer = require('gulp-autoprefixer'),
gulp_file_include = require('gulp-file-include'),
sass = require('gulp-sass'),
cleancss = require('gulp-clean-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
browserSync = require('browser-sync').create()
@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()
@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`