Skip to content

Instantly share code, notes, and snippets.

View szuc's full-sized avatar
🤓

szuc szuc

🤓
View GitHub Profile
@szuc
szuc / daily_habit_tracker.md
Created February 11, 2022 12:21
Create a daily Habit Tracking visualization in Obsidian based on front matter in the daily notes
// Create a daily Habit Tracking visualization in Obsidian
// Requires Dataview plugin
// Scans dayly notes for individual tasks recorded as children of habit property in front matter

dv.header(2,"Daily Habit Tracker");

// Returns the currently tracked Habits from the most recent daily note
// (assumes files are named by date)
let currentHabits = () => dv.array( dv.pages('"_Daily/day"')
@szuc
szuc / webpack.config.test.js
Last active March 29, 2020 13:19
Webpack config file for local Wordpress plugin development with more minification and backwards compatibility for more extensive testing.
/**
* Dev Webpack mode for cross-browser fixing
* Uses regular Webpack not Webpack-server.
* Uses BrowserSync to create a local server.
* Watch mode compiles and reloads on changes.
* Slower, css and js minification version.
*/
const path = require('path')
const webpack = require('webpack')
@szuc
szuc / webpack.config.prod.js
Created March 29, 2020 13:12
Production Webpack config file for Wordpress plugin development
/**
* Final production version.
* Minify CSS and JS
* Babel and Browser prefix for backwards compatibility
* Image minification and copy files to assets
*/
const path = require("path");
const webpack = require('webpack'); // to access built-in plugins
// deletes the assets
@szuc
szuc / webpack.config.dev.js
Last active March 29, 2020 13:14
Quick compile and server Webpack config file for local Wordpress plugin development
/**
* Dev Webpack mode
* Uses regular Webpack not Webpack-server.
* Uses BrowserSync to create a local server.
* Watch mode compiles and reloads on changes.
* Simplified version doesn't minify, etc.. to make process faster.
*/
const path = require('path');
const webpack = require('webpack');
@szuc
szuc / package.json
Last active October 9, 2022 03:26
Webpack configuration for Wordpress plugin development. Includes: package file for install and three environmnet build config files.
{
"name": "webpack-in-wordpress",
"version": "1.0.0",
"description": "Compiles scss into css and babels js files",
"main": "index.js",
"scripts": {
"build": "webpack --config webpack.config.prod.js",
"start": "webpack --config webpack.config.dev.js --progress --watch",
"test": "webpack --config webpack.config.test.js --progress --watch"
},