This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "postcss-ts-serve-boilerplate", | |
"version": "1.0.0", | |
"description": "", | |
"main": "src/ts/main.ts", | |
"scripts": { | |
"postinstall": "npm run build", | |
"postcss": "postcss src/pcss/main.pcss --output dist/css/style.css --verbose", | |
"postcss:watch": "postcss src/pcss/main.pcss --output dist/css/style.css --verbose --watch", | |
"esbuild": "esbuild ./src/ts/*.ts --splitting --bundle --minify --format=esm --log-level=info --outdir=dist/js", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env=develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* hash-based inline navigation 1.0 | |
* | |
* This script utilizes HTML5 'role' attributes to determine its contribution | |
* to inline navigation methods. Using that, and a format that works for | |
* single-level tabs as well as multi-dimensional deep tabs. | |
* | |
* <div role="tablist" id="tabs-index"> | |
* <a role="tab" href="#test"></a> | |
* <a role="tab" href="#test-two"></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Tests against humanity v1 | |
* 1. add this file to something like `{project}/tests/test.js` | |
* 2. add command `node tests/test.js` to package.json.scripts under the key "test" | |
* 3. run `npm test` | |
*/ | |
const { log } = console; | |
const lameExcuses = [ | |
"I guess it's allright-ish. Just do not take my word for it.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* const data = [...new Array(10000)]; // some huge array, browser compensates rendering because of size | |
* const pages = chunk(data, 200); // create pages from huge array | |
* pages.size; // size of the results per page | |
* pages.index; // current page index | |
* pages.data; // complete data set | |
* pages.chunks; // data set in chunks | |
* pages.get(0); // returns {pages.size} results at index [0-{pages.chunks.length}] | |
* pages.next(); // increments index and returns the result index page | |
* pages.prev(); // decrements index and returns the result index page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
An event mocking class | |
- EventEmitter.events = { event: [], event2: [] ...etc } | |
- EventEmitter.on('event', d => console.log('adds callbacks with data as d (d=whatever)')) | |
! You can use EventEmitter.on('event event') to subscribe 1 callback to multiple events. note space separator | |
- EventEmitter.emit('event', (whatever)); // => runs callbacks from event[evt] added through ~.on(..^) | |
- Special: EventEmitter.on('*') will be emitted on any 'emit'. | |
*/ | |
export default class EventEmitter { | |
constructor() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import $ from 'jquery'; | |
import EventEmitter from './event-emitter'; | |
export default class Paginator extends EventEmitter { | |
constructor(props={}) { | |
super(); | |
this.props = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
usage: | |
--- | |
a.link { | |
@include underline(red, 1px, 5px, true) | |
} | |
--- | |
above renders a red 'underline' with a 1px width, offsetted 5px from the bottom of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
.flexify should help me make flexbox grids without writing constantly | |
the same stuff over and over again. This integrates flexbox properties directly | |
in html, so you can write it like this: | |
<div class="flexify" data-space-between data-align-center> | |
<div>A</div> | |
<div>B</div> | |
<div C</div> | |
</div> |
NewerOlder