View http2.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
const http2 = require('http2'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const brotli = require('brotli'); // npm package | |
const PORT = 3032; | |
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
const cache = {}; |
View Python-List.py.groovy
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 static com.intellij.openapi.util.text.StringUtil.escapeStringCharacters as escapeStr | |
SEPARATOR = ", " | |
QUOTE = "\"" | |
NEWLINE = System.getProperty("line.separator") | |
def record(columns, dataRow) { | |
OUT.append(" {").append(NEWLINE) | |
columns.eachWithIndex { column, idx -> |
View color-log.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
function logColor(color, args) { | |
console.log(`%c ${args.join(' ')}`, `color: ${color}`); | |
} | |
const log = { | |
aliceblue: (...args) => { logColor('aliceblue', args)}, | |
antiquewhite: (...args) => { logColor('antiquewhite', args)}, | |
aqua: (...args) => { logColor('aqua', args)}, | |
aquamarine: (...args) => { logColor('aquamarine', args)}, | |
azure: (...args) => { logColor('azure', args)}, |
View KeyframeLR.py
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 timeit | |
import math | |
from typing import Sequence, Mapping, Literal, Callable | |
from torch.optim import Optimizer | |
from torch.optim.lr_scheduler import LRScheduler | |
class KeyframeLR(LRScheduler): | |
def __init__( |
View webpack.config.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
module.exports = { | |
entry: { | |
main: path.resolve(__dirname, 'src/index.js'), | |
ProductList: path.resolve(__dirname, 'src/ProductList/ProductList.js'), | |
ProductPage: path.resolve(__dirname, 'src/ProductPage/ProductPage.js'), | |
Icon: path.resolve(__dirname, 'src/Icon/Icon.js'), | |
}, | |
output: { | |
path: path.resolve(__dirname, 'dist'), |
View deconstructions.csv
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
Word | Deconstruction | |
---|---|---|
it's | it ~is | |
years | year ~s | |
going | go ~ing | |
that's | that ~is | |
i'm | i ~am | |
things | thing ~s | |
states | state ~s | |
including | include ~ing | |
called | call ~ed |
View css-breakpoint-mixins.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
@mixin for-phone-only { | |
@media (max-width: 599px) { @content; } | |
} | |
@mixin for-tablet-portrait-up { | |
@media (min-width: 600px) { @content; } | |
} | |
@mixin for-tablet-landscape-up { | |
@media (min-width: 900px) { @content; } | |
} | |
@mixin for-desktop-up { |
View webpack.config.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
const path = require('path'); | |
module.exports = { | |
entry: path.resolve(__dirname, 'src/index.js'), | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: '[name].[contenthash].js', | |
}, | |
optimization: { | |
splitChunks: { |
View webpack.config.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
const path = require('path'); | |
const webpack = require('webpack'); | |
module.exports = { | |
entry: path.resolve(__dirname, 'src/index.js'), | |
plugins: [ | |
new webpack.HashedModuleIdsPlugin(), // so that file hashes don't change unexpectedly | |
], | |
output: { | |
path: path.resolve(__dirname, 'dist'), |
View Icon.jsx
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 React from 'react'; | |
const {PropTypes} = React; | |
const Icon = props => { | |
const styles = { | |
svg: { | |
display: 'inline-block', | |
verticalAlign: 'middle', | |
}, | |
path: { |
NewerOlder