<ReadMore :trim-count="20">
<p>Content to be trimmed, that <strong>can</strong> contain markup</p>
</ReadMore>
This file contains hidden or 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 React, { useEffect, useRef, useState, useCallback } from 'react'; | |
| const strokeColor = 'oklch(var(--ac))'; | |
| /** | |
| * Component that serves as a progress indicator. | |
| * It shows a progress bar as if it were a border around the box. | |
| * The progress bar is a percentage of the total size of container sides length. | |
| */ | |
| export default function ProgressContainer({ |
This file contains hidden or 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
| apt install -y unzip php8.3-fpm sqlite3 nodejs npm git nginx php8.3-common php8.3-xml php8.3-sqlite3 php8.3-zip | |
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
| php composer-setup.php | |
| php -r "unlink('composer-setup.php');" | |
| mv composer.phar /usr/local/bin/composer | |
| phpenmod dom | |
| apt install | |
| apt install | |
| phpenmod dom |
This file contains hidden or 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
| class Person { | |
| // Potentially expensive calculation. | |
| late final netWorth = | |
| (() => Future.delayed(Duration(seconds: 2), () => 99))(); | |
| } | |
| // await person.netWorth |
This file contains hidden or 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 reduce from './reduce'; | |
| import setSessionIdContext from './setSessionIdContext'; | |
| import setSessionIdCookie from './setSessionIdCookie'; | |
| import setCacheControlHeader from './setCacheControlHeader'; | |
| addEventListener('fetch', async (event) => { | |
| const { request: sourceRequest } = event; | |
| let context = {}; | |
| const targetRequest = reduce([ |
- Don’t use
switchstatements (they are slow, can lead to bugs if you don’tbreakor “fail” silently when none of cases match). Use object literals instead, i.e.
// NoNo
switch (expression) {
case 'a': {
doStuff();
break;
This file contains hidden or 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 Vue from 'vue'; | |
| const fireEvent = (name, ctx, args) => { | |
| ctx.data.on && ctx.data.on[name] && ctx.data.on[name].apply(null, args); | |
| } | |
| const createInput = (h, ctx, item) => ({ | |
| 'text': createTextInput, | |
| 'checkbox': createCheckboxInput | |
| }[item.type || 'text'](h, ctx, item)); |
This file contains hidden or 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 arr = [ | |
| { id: "a", foo: "aaaaa", bar: "AA" }, | |
| { id: "b", foo: "bbbbb", bar: "BB" }, | |
| { id: "c", foo: "ccccc", bar: "CC" } | |
| ]; | |
| const obj = arr.reduce((sum, e) => Object.assign(sum, {[e.id]: e}), {}); |
This file contains hidden or 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
| apt-get update && apt-get install -y -qq libpq-dev postgresql-server-dev-all postgresql-9.4-repack | |
| --fix-missing --no-install-recommends | |
| psql -c "CREATE EXTENSION IF NOT EXISTS pg_repack" -d $1 -U postgres |
This file contains hidden or 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
| .git | |
| .gitignore | |
| doc | |
| .yardoc | |
| coverage | |
| jsdoc | |
| tmp | |
| log | |
| README.md | |
| public/uploads/ |