Skip to content

Instantly share code, notes, and snippets.

View tibdex's full-sized avatar

Thibault Derousseaux tibdex

View GitHub Profile
@tibdex
tibdex / list-accessible-repositories.js
Created June 27, 2019 20:36
List all repositories that a GitHub App can access.
const { App } = require("@octokit/app"); // ^3.0.0
const Octokit = require("@octokit/rest"); // ^16.25.0
const APP_ID = 1337;
const PRIVATE_KEY = `-----BEGIN RSA PRIVATE KEY-----
...
your private key content
...
-----END RSA PRIVATE KEY-----`;

Keybase proof

I hereby claim:

  • I am tibdex on github.
  • I am tibdex (https://keybase.io/tibdex) on keybase.
  • I have a public key whose fingerprint is F6AF B671 E754 8984 ABF0 9433 4D70 CA27 CD3E 4D39

To claim this, I am signing this object:

@tibdex
tibdex / absolute-to-relative.js
Created December 9, 2016 19:22
jscodeshift codemod to change imports of internal modules using absolute path to relative path
/**
* This codemod expects 2 CLI arguments:
* - packageDir: the path of the directory containing the package.json. It's used to detect whether a path points
* to a dependency or an internal module.
* - rootDirs: root directory paths separated by a comma if you have more than one root.
* Let's say that you have two files:
* - src/component.js
* - src/index.js containing the import "import Component from 'component.js';"
* To have the transformation successfully working you need to call jscodeshift with the "--rootDirs ./src" argument.
*/