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, { useEffect } from "react" | |
import { META_DESCRIPTION } from "../../util" | |
export const Page: React.FC<{ | |
title?: string | |
metaDescription?: string | |
}> = props => { | |
useEffect(() => { | |
document.title = props.title ?? "Execute Program" |
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
commit 9f676b29d4a49356e756048ff249d17e552b5faa (HEAD -> master, origin/master) | |
Author: Gary Bernhardt <gary.bernhardt@gmail.com> | |
Date: Sun Mar 15 13:36:55 2020 -0700 | |
cache public dir between deploys (note) | |
Problem: | |
1. A deploy starts. | |
2. A browser starts loading a page. | |
3. The deploy finishes. |
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
ES2015 | |
Optimisation | |
proper tail calls (tail call optimisation) | |
Syntax | |
default function parameters | |
rest parameters | |
spread syntax for iterable objects | |
object literal extensions | |
for..of loops | |
octal and binary literals |
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
{ | |
"extends": "../tsconfig.json", | |
"compilerOptions": { | |
"composite": true, | |
"rootDir": ".", | |
"outDir": "../../build/common" | |
}, | |
"include": ["."] | |
} |
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 f() { | |
switch (x) { | |
case "1": | |
<div>foo</div> | |
case "2": | |
return <div> | |
<div> | |
foo | |
</div> | |
<div>foo</div> |
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 webpack = require('webpack'); | |
const path = require('path'); | |
const StatsWriterPlugin = require("webpack-stats-plugin").StatsWriterPlugin | |
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
const production = process.env.RACK_ENV == 'production' | |
const config = { | |
mode: production ? "production" : "development", | |
entry: './build/client/app.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
// This has been updated. You'll have to go back in time in the gist history to | |
// see older versions. | |
const { writeSync } = require("fs") | |
const async_hooks = require("async_hooks") | |
async function printLeakedEvents(f) { | |
// Track all active event IDs | |
const eventIDs = new Set() |
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
rubocop | egrep ' (W|C): ' | cut -d ' ' -f 3 | sort -u | sed 's/:$//' | while read cop; do | |
git checkout . | |
rubocop -a --only "$cop"; | |
if [[ $(git diff --stat) != '' ]]; then | |
git add --all | |
git commit -m "fix rubocop cop $cop" | |
fi | |
done |
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
#!/usr/bin/env ruby | |
# This script tests par2 recovery when the par2 files themselves are corrupted. | |
# Process: | |
# 1. Generate a file containing all 256 possible bytes. | |
# (More would be better, but it gets slow fast.) | |
# 2. Generate par2 data for the file. | |
# 3. Individually corrupt each par2 file at each offset. | |
# (Write byte 0 unless the offset already contains byte 0; then, write byte 255.) | |
# (Writing each possible byte would be better, but it gets slow fast.) |
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
#!/usr/bin/env ruby | |
require 'base64' | |
require 'nokogiri' | |
require 'uri' | |
def main | |
html = Nokogiri::HTML($stdin.read) | |
inline_all_images(html) | |
inline_all_css(html) |
NewerOlder