Skip to content

Instantly share code, notes, and snippets.

Imposter Syndrome

Nick DiMatteo ndimatteo

Imposter Syndrome
View GitHub Profile
View !Beyond Dark
ndimatteo / !Advanced Link
Last active Aug 16, 2022
Advanced Link Component for Next.js
View !Advanced Link
ndimatteo / _Sanity - Async Conditional
Last active Jun 22, 2021
Sanity Conditional Fields (async)
View _Sanity - Async Conditional

Async Conditional Fields for Sanity

Asynchronous multiple fields Sanity UI Easy!

Show multiple fields in an object field, based on a condition set through the "options" object. Simply return true/false from "condition" function, even asynchronously!

View gist:8273988
remote: npm ERR! install Couldn't read dependencies
remote: npm ERR! Error: ENOENT, open '/var/sites/'
remote: npm ERR! If you need help, you may report this log at:
remote: npm ERR! <>
remote: npm ERR! or email it to:
remote: npm ERR! <>
remote: npm ERR! System Linux 3.2.0-23-virtual
remote: npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
remote: npm ERR! cwd /var/sites/
View gist:8234088
$('.add-coupon').each(function() {
$(this).click(function() {
var couponVal = $('.coupon', this).val();
$('span', this).text('Applying');
$.getJSON('/check-coupon', {
coupon: couponVal
}, function(data) {
// Invalid
if (!data.valid) {
View 4.js
app.get('/check-coupon', function(req, res, next) {, function(err, coupon) {
if (err) return res.json({ valid: false });
res.json({ valid: true });
View style.css
.header {
background: #2d2d2d;
.content {
background: #2d2d2d;