Skip to content

Instantly share code, notes, and snippets.

@martinherweg
martinherweg / input.scss
Created March 18, 2022 12:23
Generated by SassMeister.com.
@use 'sass:map';
$themes: ['default', 'yellow', 'purple-yellow', 'gold', 'midnight-blue', 'purple-blue'];
$themeIcons: ();
@each $theme in $themes {
$index: index($themes, $theme);
@if $theme == 'default' {
@martinherweg
martinherweg / input.scss
Created March 18, 2022 12:07
Generated by SassMeister.com.
@use 'sass:map';
$themes: ['default', 'yellow', 'purple-yellow', 'gold', 'midnight-blue', 'purple-blue'];
$themeIcons: ();
@each $theme in $themes {
$index: index($themes, $theme);
$themeIcons: map.set($themeIcons, $theme, 'theme#{$index}')
}
/* eslint-disable */
import Vue from "vue";
import VueCompositionAPI, {
computed,
onBeforeMount,
reactive,
toRefs,
} from "@vue/composition-api";
import { useVideoPlayer } from "../../../helpers/videoPlayer/videoPlayerFunctions";
/**
* Webpack Config for Javascript and CSS Bundling
*
* @package generator-lilly
* @author Martin Herweg <[email protected]>
*/
import webpack from 'webpack';
import { getIfUtils, removeEmpty } from 'webpack-config-utils';
import path from 'path';
@martinherweg
martinherweg / module.php
Created May 1, 2018 09:10
Craft Commerce 2 Extend Snapshots
Event::on(LineItems::class, LineItems::EVENT_POPULATE_LINE_ITEM, function (LineItemEvent $event) {
$purchasable = $event->lineItem->purchasable;
$lineItem = $event->lineItem;
$productImageUrl = '';
$imageOptimize = [];
if (count($purchasable->product->productImage) > 0) {
$productImageUrl = $purchasable->product->productImage->one()->getUrl();
if (Craft::$app->plugins->isPluginInstalled('image-optimize')) {
import chalk from 'chalk';
/**
|--------------------------------------------------------------------------
| gulp browser-sync
|--------------------------------------------------------------------------
*
* Browser Sync
* @description Refresh the Brwoser after File Change.
* Combined with webpack for HMR or Content Reload
@martinherweg
martinherweg / DepartmentFile.json
Last active November 13, 2017 13:12
Create new Sections based on a Base JSON
{
"sections": [
{
"name": "A New Section",
"handle": "a_new_section_handle"
}
]
}
@martinherweg
martinherweg / index.js
Created August 4, 2017 12:22
Jetbrains Request #1052740
// No kind of Autocomplete works for in these import styles
// Vue Lazyloading of Routes
const Confirmation = () => import(/* webpackChunkName: 'router-confirmation' */ 'Js/views/Confirmation.vue');
const Tnbs = () => import(/* webpackChunkName: 'router-tnbs' */ 'Js/views/Tnbs.vue');
const Privacy = () => import(/* webpackChunkName: 'router-privacy' */ 'Js/views/Privacy.vue');
// Normal Lazyloading as described in the webpack Documentation
// Autocomplete doesn't work eithe
import('Components/testFunction')
@martinherweg
martinherweg / .babelrc
Last active August 3, 2017 19:26
webpack config with es2015 features
{
"presets":
[
"es2015"
]
}
@martinherweg
martinherweg / _moduleTmpl.js
Last active July 24, 2017 12:26
Create a Module in the Modules Folder
/*
|--------------------------------------------------------------------------
| <%= moduleName.replace('-', '_') %>
|--------------------------------------------------------------------------
*/
export default function() {
console.log('Initialize: <%= moduleName.replace('-', '_') %>');
}