Skip to content

Instantly share code, notes, and snippets.

View forde's full-sized avatar

Konrad Węgrzyniak forde

View GitHub Profile
@forde
forde / astro.config.mjs
Created January 8, 2026 07:58
Exclude pages from astro build
import { defineConfig } from 'astro/config';
import { fileURLToPath } from 'node:url';
import { rmSync, existsSync } from 'node:fs';
function excludePreviewPages() {
return {
name: 'exclude-preview-pages',
hooks: {
'astro:build:done': ({ dir, logger }) => {
const shouldExcludePreviewPages = ['production', 'staging'].includes(process.env.BUILD_CONTEXT)
@forde
forde / cal.js
Last active March 18, 2022 09:46
import moment from 'moment'
import 'moment/locale/nb'
const array = length => [...Array(length).keys()]
const dayProps = (_moment, selectedDays=[]) => {
return {
_moment: _moment,
date: _moment.format('YYYY-MM-DD'),
isToday: _moment.isSame(moment(), 'day'),
@forde
forde / builder.php
Last active March 15, 2018 12:07
ACF builder enhancement
<?php
/**
* ACF flex content builder enhancements
*
* SETUP:
* - set correct value for $builder_field_key
* - set correct value for $theme_name
* - set correct value for $flex_content_field_name
* - create 'builder-cons' folder in your theme and put icons for all modules there (use FLEXIBLE_CONTENT_LAYOUT_NAME.svg [105x105px] for each icon)
@mixin media_query($screen) {
@if $screen == orange {
@media only screen and (max-width: 1200px) { @content; }
}
@if $screen == red {
@media only screen and (max-width: 992px) { @content; }
}
@if $screen == aqua {
//All from portrait ipad down
@media only screen and (max-width: 768px) { @content; }