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
// https://github.com/muhammadghazali/mod10 | |
function LuhnAlgorithm(RSA_ID: string) { | |
let isValid = false; | |
let checkDigit; | |
let sumOfAllNumbers = 0; | |
let reversedIdentifier = []; | |
const identifierString = RSA_ID; | |
checkDigit = identifierString.charAt(identifierString.length - 1); |
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 Headline = ({ as = 'h1', children }) => { | |
const As = as; | |
return <As>{children}</As>; | |
}; | |
const App = () => { | |
return ( | |
<> | |
<Headline>Hello React</Headline> | |
<Headline as="h2">Hello React</Headline> |
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
/* Box sizing rules */ | |
html { | |
box-sizing: border-box; | |
} | |
/* Set core root defaults */ | |
html:focus-within { | |
scroll-behavior: smooth; | |
} |
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
// https://matthiasott.com/notes/how-i-structure-my-css | |
/scss/ | |
├── 1-settings | |
│ └── _global.scss | |
├── 2-design-tokens | |
│ ├── _colors.scss | |
│ ├── _fonts.scss | |
│ ├── _media-queries.scss | |
│ ├── _spacing.scss |
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
// https://piccalil.li/blog/a-modern-css-reset | |
/* Box sizing rules */ | |
*, | |
*::before, | |
*::after { | |
box-sizing: border-box; | |
} | |
/* Remove default margin */ |
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
function backpressureAwareCopy(srcStream, destStream) { | |
srcStream.on('data', (chunk) => { | |
const canContinue = destStream.write(chunk); | |
if (!canContinue) { | |
// if we are overflowing the destination, we stop reading | |
srcStream.pause(); | |
// once all the buffered data is flushed, we resume reading from source | |
destStream.once('drain', () => srcStream.resume()); | |
} | |
}) |
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
// This query returns a list of tables, in alphabetical order, with a count of the columns. | |
SELECT table_name | |
,COUNT(column_name) | |
FROM information_schema.columns | |
WHERE table_schema = 'myschema' -- put your schema here | |
GROUP BY table_name | |
ORDER BY table_name; | |
// This query returns a list of tables, in alphabetical order, with a count of the rows. |
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 { fileURLToPath } from 'url'; | |
import { dirname } from 'path'; | |
console.log(`import.meta.url: ${import.meta.url}`); | |
const __filename = fileURLToPath(import.meta.url); | |
const __dirname = dirname(__filename); | |
console.log(`dirname: ${__dirname}`); | |
console.log(`filename: ${__filename}`); |
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
FROM node:10.16.2-stretch | |
EXPOSE 3000 | |
ENV NODE_ENV production | |
# Create work environment and set up app | |
RUN mkdir /app && chown -R node:node /app | |
WORKDIR /app | |
USER node |
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
// Use a font size that makes lowercase | |
letters half the specified font size | |
@supports (font-size-adjust: 1;) { | |
article { | |
font-size-adjust: 0.5; | |
} | |
} | |
// optimal line height | |
p { |
NewerOlder