Skip to content

Instantly share code, notes, and snippets.

View JoshuaKGoldberg's full-sized avatar
🌴
Mostly on vacation through 5/20. Expect little.

Josh Goldberg ✨ JoshuaKGoldberg

🌴
Mostly on vacation through 5/20. Expect little.
View GitHub Profile
@JoshuaKGoldberg
JoshuaKGoldberg / index.tsx
Last active March 29, 2020 17:55
React Components Options
// Option one??
interface MyThingProps { /* ... */ };
function MyThing({ text }: MyThingProps { /* ... */ };
// Option two??
type MyThingProps = { /* ... */ };
@JoshuaKGoldberg
JoshuaKGoldberg / line.sh
Created March 29, 2020 17:47
Chart generation for TypeScript: auxillary file
printf "$(git log -1 --format=%ad --date=short),"
printf "$(find webpack/assets/ -type f | grep '.js' | grep -v 'node_modules' | grep -v '.json' | wc -l | sed 's/ //g'),"
printf "$(find webpack/assets/ -type f | grep '.tsx\\?$' | grep -v 'node_modules' | wc -l | sed 's/ //g')"
echo ""
@JoshuaKGoldberg
JoshuaKGoldberg / generate.sh
Last active April 3, 2020 20:11
Chart generation for TypeScript: main file
git log --pretty=format:"%h" > commits.txt
echo "Date,JavaScript,TypeScript" > output.csv
xargs < commits.txt -n 1 | xargs -I % sh -c "git reset --hard %; sh line.sh >> output.csv"
echo "Done 🎉"
@JoshuaKGoldberg
JoshuaKGoldberg / babel.config.js.diff
Last active March 29, 2020 17:44
Babel configuration diff
const presets = [
'codecademy',
+ '@babel/preset-typescript',
];
@JoshuaKGoldberg
JoshuaKGoldberg / log.txt
Created March 11, 2020 16:59
turtle CLI output
This file has been truncated, but you can view the full file.
Mar 11 11:54:30 turtle[35911] INFO: Using manifest: {"ios":{"infoPlist":{"UIUserInterfaceStyle":"Light"},"appStoreUrl":"https://itunes.apple.com/us/app/codecademy-go/id1376029326?ls=1&mt=8","buildNumber":"2","supportsTablet":false,"bundleIdentifier":"com.ryzac.codecademygo"},"icon":"./src/app/assets/images/icon.png","name":"Codecademy Go","slug":"codecademy-go","extra":{"MOBILE_SECRET":"XCL9eznoqYa4aWLiQQzs"},"scheme":"codecademy-go","splash":{"image":"./src/app/assets/images/splash-dark.png","imageUrl":"https://d1wp6m56sqw74a.cloudfront.net/~assets/c3df84d2ab22a665b61193937d7b2b79","resizeMode":"cover","backgroundColor":"#161C38"},"android":{"icon":"./src/app/assets/images/icon.png","iconUrl":"https://d1wp6m56sqw74a.cloudfront.net/~assets/2087c0ceb3787b69e0d6928ed934296b","package":"com.ryzac.codecademygo","permissions":[],"versionCode":51,"adaptiveIcon":{"backgroundColor":"#4B35EF","foregroundImage":"./src/app/assets/images/android-icon.png","foregroundImageUrl":"https://d1wp6m56sqw74a.cloudfront.net/
describe("Cheese", () => {
it("renders milk when aging is not yet complete", () => {
const wrapped = mount(<Cheese />);
expect(wrapped.text()).toBe("🥛");
});
it("renders cheese when aging has completed", () => {
const wrapped = mount(<Cheese />);
const { clock } = useGlobals();
@JoshuaKGoldberg
JoshuaKGoldberg / README.md
Last active November 25, 2019 17:03
Codecademy Public CLA

Contribution License Agreement

This Contribution License Agreement ("Agreement") is agreed to by the party signing below (“You”), and conveys certain license rights to Ryzac, Inc and its affiliates (“RyzacInc”) for Your contributions to RyzacInc open source projects. This Agreement is effective as of the latest signature date below.

1. Definitions

"Code" means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to RyzacInc under this Agreement. “Project” means any of the projects owned or managed by RyzacInc in which software is offered under a license approved by the Open Source Initiative (OSI) (www.opensource.org) and documentation offered under an OSI or a Creative Commons license (https://creativecommons.org/licenses). “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any Project, including but not limited to communication on electronic mailing lists, source code control systems, and

@JoshuaKGoldberg
JoshuaKGoldberg / binary.ts
Last active August 6, 2019 21:51
Silly Binary Logic in TypeScript's Type System
type Bit = 0 | 1;
type BitFlip<A> = A extends 0
? 1
: 0;
type BitOr<A, B> = [A, B] extends [0, 0]
? 0
: 1;
@JoshuaKGoldberg
JoshuaKGoldberg / my-esri.js
Created May 2, 2019 12:59
Wrapping and exporting an ambient @types module
// webpack/assets/javascripts/my-esri
// This file should be in that path 👆 but Gists don't allow subpaths...
// I'm not super sure this works the way I want it to
// In theory, this /// include should only import the types into *this* file's context, not the ambient context
// 🤷
/// <reference path="../../../node_modules/@types/esri/index.d.ts" />
export const Esri = window.Esri;
@JoshuaKGoldberg
JoshuaKGoldberg / esri.d.ts
Last active May 2, 2019 12:59
Replacing an incorrect @types definition
// webpack/assets/javascripts/esri.d.ts
// This file should be in that path 👆 but Gists don't allow subpaths...
declare module "esri" {
const wat: string;
export wat;
}