Skip to content

Instantly share code, notes, and snippets.

@phanan
phanan / MyList.vue
Last active February 2, 2023 17:10
Virtual scroller with Vue Composition API
<template>
<VirtualScroller v-slot="{ item }" :item-height="35" :items="myMassiveArray">
<div :item="item" :key="item.id">{{ item.details.i.guess? }}</div>
</VirtualScroller>
</template>
@nkbt
nkbt / .eslintrc.js
Last active May 11, 2024 13:03
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@hdragomir
hdragomir / sm-annotated.html
Last active June 13, 2024 03:01
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);