Skip to content

Instantly share code, notes, and snippets.

View JvanderHeide's full-sized avatar

Jeffrey van der Heide JvanderHeide

View GitHub Profile
@bennettdams
bennettdams / zod-empty-string-undefined-optional.ts
Last active April 3, 2024 16:20
Zod empty string transformed to `undefined` including handling optional
import { z } from 'zod'
const emptyStringToUndefined = z.literal('').transform(() => undefined)
/**
* Provide a schema and get a schema that is optional and empty strings are transformed to `undefined`.
* When someone removes his input of this field, the then empty string is transformed to `undefined`.
*
* Example:
*
@davatron5000
davatron5000 / the-state-of-element-container-queries.md
Last active August 23, 2023 15:43
The State of Element/Container Queries

The State of Container Queries

tl;dr Developers would like the idea to style components based on a parent's width rather than depend solely on the viewport media query. This would allow modular components to style themselves while being agnostic to the viewport.

There is currently a lot of developer interest in getting a feature like Container Queries (née "Element Queryies") shipped in a browser.

2-min Catchup

Here are official'ish documents to outline the developer community's desires.

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
<?php
/*
* This file is part of the Twig Extension TruncateHtmlExtension.
*
* Author Leon Radley <leon@radley.se>
* Rewrite by Instabledesign
*
*
* Truncate Html string without stripping tags
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
<?php
/*
* This file is part of the Twig Extension TruncateHtmlExtension.
*
* Author Leon Radley <leon@radley.se>
* Rewrite by Instabledesign
*
*
* Truncate Html string without stripping tags
@hereswhatidid
hereswhatidid / wp-config.php
Last active December 16, 2015 14:19
Useful wp-config.php options for WordPress
<?php
// Disable reinstalling Akismet and Hello, Dolly! plugins
// when upgrading WordPress core
define( 'CORE_UPGRADE_SKIP_NEW_BUNDLED', true);
// Disable built-in file editor
define('DISALLOW_FILE_EDIT', TRUE)
@desandro
desandro / bower-logo.md
Last active December 30, 2021 23:11
Bower logo

In addition to awesome docs #228, Bower deserves a proper logo. See below for sketches. I'm curious if you think any of these are worth me putting more effort into.


Take a look at Yeoman right now.

Screen Shot 2013-02-19 at 4 43 10 PM

The other two entities have awesome logos. Bower's got to represent.