Skip to content

Instantly share code, notes, and snippets.

View jonchurch's full-sized avatar
♥️

Jon Church jonchurch

♥️
View GitHub Profile
@jonchurch
jonchurch / watch.md
Last active January 24, 2022 15:03
Watch all repos in a github org

Watch All Repos in a Github Organization

Visit your tokens page and generate a new token with the scopes repo, notifications.

Copy it to your clipboard. Keep the page open until you're done watching orgs, in case you need to copy it again.

Then open your terminal and replace TOKEN with your token and YOURORG with the organization or username that you want to watch in the following command:

WATCH_GH_REPOS=TOKEN npx watch-gh-repos -o -w YOURORG
#!/bin/bash
# Basic user preference setup
sudo yum update -y
sudo yum install -y git zsh tmux util-linux-user
cd /home/ec2-user || exit
# oh-my-zsh
@jonchurch
jonchurch / v3.2.0.txt
Created February 28, 2020 23:31
path-to-regexp pack size
npm notice
npm notice 📦 [email protected]
npm notice === Tarball Contents ===
npm notice 1.1kB LICENSE
npm notice 10.5kB index.js
npm notice 1.1kB package.json
npm notice 5.5kB History.md
npm notice 9.0kB Readme.md
npm notice 3.7kB index.d.ts
npm notice === Tarball Details ===
@jonchurch
jonchurch / timeoutTest.js
Created February 19, 2020 01:13
Thinking through timeouts
const https = require('https');
const options = {
host: 'exoplanetarchive.ipac.caltech.edu',
path: '/cgi-bin/nstedAPI/nph-nstedAPI?table=exoplanets&select=*&format=json',
// apply an initial timeout which will apply to the connect event
timeout: 2000,
};
const beforeRequest = Date.now();
@jonchurch
jonchurch / gqlScratch.js
Created January 29, 2020 05:11
Scratch for getting Github Issues from a list of orgs
require('dotenv').config()
const fetch = require('node-fetch')
const GITHUB_GRAPHQL_URL = 'https://api.github.com/graphql'
const headers = { Authorization: `bearer ${process.env.GITHUB_TOKEN}`, 'Content-Type': 'application/json' }
async function getRepoCountForOrg (org) {
const query = `query($org: String!){
organization(login: $org) {
repositories{
totalCount
@jonchurch
jonchurch / 404.txt
Created January 23, 2020 05:52
404'd links on expressjs.com
404 - http://nodesecurity.io/advisories/send-directory-traversal
found on:
expressjs.com/ko/advanced/security-updates.html
expressjs.com/de/advanced/security-updates.html
expressjs.com/th/advanced/security-updates.html
expressjs.com/zh-tw/advanced/security-updates.html
expressjs.com/fr/advanced/security-updates.html
expressjs.com/ru/advanced/security-updates.html
expressjs.com/tr/advanced/security-updates.html
expressjs.com/en/advanced/security-updates.html
@jonchurch
jonchurch / faveTalks.md
Last active October 11, 2019 02:17
My Fave JavaScript Talks ✨

My Fave JavaScript Talks ✨

To make NodeJS successful, we need everyone's help. And everyone isn't here.

This talk had a huge impact on me when I was still working in restaurants, listening to podcasts and talks during my shifts, and learning to code at night. Although I'm more privileged than many, I have no college degree and come from a background and industry completely different than most folks in tech. I never dreamt that I could be able to work with the Node.js collaborators. Watching this talk gave me hope that not only could I one day be welcome in the Node community, but that I could be valuable to it. Seeing that people were fighting to create a community that I could participate in moved me so much, and planted a seed in my head which is now bearing fruit after years of hard work. Thank you, Ashley!

Rewatching this talk now is crazy for me, because I see faces in it that I have met and had lovely conv

@jonchurch
jonchurch / instanceOfArrow.js
Created August 19, 2019 18:46
Using instanceof without throwing on arrow functions
const arrow = () => true;
class ExampleClass {}
const classInst = new ExampleClass();
// this throws
try {
classInst instanceof arrow;
} catch (err) {
console.log("arrow has no prototype", err);
}
@jonchurch
jonchurch / chonkArray.js
Created July 23, 2019 21:35
Array Chonk (Array chunking)
function chonkArray(array, chonkSize) {
let arrayOfChonks = [];
for (let i = 0; i < array.length; i += chonkSize) {
const chonk = array.slice(i, i + chonkSize);
arrayOfChonks.push(chonk);
}
return arrayOfChonks;
}
const chonkable = ["🍕","🐡","🍝","🐙","✨"]
@jonchurch
jonchurch / for_of.js
Last active December 29, 2019 09:43
Experimenting with sequential iteration using async/await
const array = [1, 2, 3];
function sleep(nSeconds) {
return new Promise((resolve, reject) => {
setTimeout(() => resolve(nSeconds), nSeconds * 1000);
});
}
async function run() {
for (const interval of array) {