Skip to content

Instantly share code, notes, and snippets.

View nicolasembleton's full-sized avatar
🏠
Working from home

Nicolas Embleton nicolasembleton

🏠
Working from home
View GitHub Profile
@hayatoShingu
hayatoShingu / angularJS_lawnchair_wrapper.js
Last active November 8, 2018 08:44
It wraps Lawnchair as a provider, allowing you to set global configuration before your dependencies are getting injected
//inspired by https://github.com/wspringer/angular-pouchdb
//lawnchar simple wrapper
//
//It wraps Lawnchair as a provider, allowing you to set global configuration before your
//dependencies are getting injected
//
//It uses $q-based promises instead of callbacks: db.get({...}) will return a promise with the results,
//and no longer accepts a callback as the last parameter.
//The same goes for all other operations that normally required callbacks.
//
@Vectorized
Vectorized / YulSnippets.sol
Last active April 29, 2023 21:55
Solidity Yul Assembly Snippets
// SPDX-License-Identifier: MIT
// Author: vectorized.eth
pragma solidity ^0.8.0;
pragma abicoder v2;
// DISCLAIMER:
// This is experimental software and is provided on an "as is" and "as available" basis.
// We do not give any warranties and will not be liable for any loss incurred through any use of this codebase.
library Base64 {

Adapted from this recommendation by @jandockx

Cyclical objects

Despite supporting recursive schemas, passing cyclical data into Zod will cause an infinite loop in some cases.

You can protect against cyclical objects starting an infinite loop (at a performance cost) with the following approach (using the above jsonSchema as an example):