Skip to content

Instantly share code, notes, and snippets.

View dan-gamble's full-sized avatar

Dan Gamble dan-gamble

View GitHub Profile
/* eslint-disable no-undef */
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const isDevelopment = process.env.NODE_ENV === 'development'
const alias = {
jQuery: path.resolve('./node_modules/jquery'),

Before

function calculateItems (value, index) {
  $.ajax({
    type: "POST",
    url: "https://www.hyperioncomposites.com/calculators/decking-calc-v3.php",
    data: value,
    async: false,
    success: function (data) {
 calcResults[index] = JSON.parse(data);
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEtSiW0xbYQys4lu3+RBWEGBNHg2arBmOOek4VMReuXrMF5Aylkwhduotn76PuXNtuDp31RvTwbtlw0MIREmWdDCHmzmiD8jTdGRNwbuGlCCV95reUSEVffBJzHohTwsCHeUXKsS/W6kQCNYLgg0E7WQiSmRbijkGgbvH800sTAEjhsSKw9+MokrFcN5yIEJBqxtGLxY5SjVi3C3CQw3BXpYsAk5gVqVMlVCdkBkPr5brNhV4IS625pTAbX5Vtnd6yo+M7Ob3Xc9UuRWt4fyzt3GXG/tSrl3n1Asw994Skh1HQBPY8ksjRiKiZeo+5UPCJfX4Y1vIrCD8AceaDty2r
setupResponsiveAspects () {
const aspectRatioHolder = this.el.querySelector('.img-Image_AspectRatio')
Object.entries(this.responsiveAspects).forEach(([viewport, aspectRatio]) => {
switch (viewport) {
case 'xxs-viewport': {
const resizeFnc = () => {
aspectRatioHolder.style.paddingBottom = isXxsViewport(window.innerWidth)
? aspectRatio
: this.responsiveAspects['default']
import { debounce, getOffsetTop, mediaBreakpoints, scrollToY } from '../utils'
export default class Steps {
constructor ({ el }) {
const _this = this
this.els = {
el,
images: {
container: el.querySelector('.js-Steps_Images'),
import { debounce, getOffsetTop, mediaBreakpoints, scrollToY } from '../utils'
export default class Steps {
constructor ({ el }) {
this.els = {
el,
images: {
container: el.querySelector('.js-Steps_Images'),
items: el.querySelectorAll('.js-Steps_Image')
},
--- imports/news.py (original)
+++ imports/news.py (reformatted)
@@ -55,7 +55,10 @@
the_obj = current_object.__class__.objects.get(**search_data)
return the_obj
- def locate_object(self, original_class, original_pk_name, the_class, pk_name, pk_value, obj_content):
+ def locate_object(
+ self, original_class, original_pk_name, the_class, pk_name, pk_value,
+ obj_content
export default class LazyImage {
constructor ({el}) {
this.el = el
this.aspectRatio = el.dataset.aspectRatio
this.smallImageUrl = el.dataset.smallImageUrl
this.largeImageUrl = el.dataset.largeImageUrl
this.supportsObjectFit = 'objectFit' in document.documentElement.style
this.loadedClass = 'img-Image_Image-loaded'
class CardCollection(models.Model):
user = models.OneToOneField('users.User', on_delete=models.CASCADE)
def __str__(self):
return f"{self.user}'s card collection"
class CardPlayer(models.Model):
collection = models.ForeignKey('users.CardCollection')
player = models.ForeignKey('players.Player')