Skip to content

Instantly share code, notes, and snippets.

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

Arthur G. Buhl arthurbuhl

🏠
Working from home
View GitHub Profile
@arthurbuhl
arthurbuhl / image-reset.css
Created February 27, 2024 05:32 — forked from palashmon/image-reset.css
A More Effective CSS Image Reset
/**
* This CSS block is a More Effective CSS Image Reset.
* It resets the default styles of an image element
* and adds some additional styles to improve its rendering.
*
* The `max-width: 100%;` ensures that the image does not exceed its container's width,
* while maintaining its aspect ratio with `height: auto;`.
*
* The `vertical-align: middle;` aligns the image vertically with the text.
*
@palashmon
palashmon / image-reset.css
Created November 17, 2023 07:44
A More Effective CSS Image Reset
/**
* This CSS block is a More Effective CSS Image Reset.
* It resets the default styles of an image element
* and adds some additional styles to improve its rendering.
*
* The `max-width: 100%;` ensures that the image does not exceed its container's width,
* while maintaining its aspect ratio with `height: auto;`.
*
* The `vertical-align: middle;` aligns the image vertically with the text.
*
@palashmon
palashmon / Prettify.ts
Created May 13, 2023 16:11
A super useful type helper in TypeScript by Matt Pocock from Twitter
/**
* A TypeScript type alias called `Prettify`.
* It takes a type as its argument and returns a new type that has the same properties as the original type,
* but the properties are not intersected. This means that the new type is easier to read and understand.
*/
type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
@kentcdodds
kentcdodds / index.html
Last active June 24, 2021 19:48
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
@palashmon
palashmon / bling-0.2.0.js
Created July 12, 2017 15:06
bling dot js [updated]
// based on https://gist.github.com/paulirish/12fb951a8b893a454b32
const $ = document.querySelector.bind(document);
const $$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@palashmon
palashmon / bling.js
Created July 12, 2017 14:50 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;