Skip to content

Instantly share code, notes, and snippets.

View gr2m's full-sized avatar
🧚
automatin'

Gregor Martynus gr2m

🧚
automatin'
View GitHub Profile
@gr2m
gr2m / worker.js
Created August 27, 2019 05:40
A Cloudflare worker to exchange an OAuth Web Flow code for an access token. Configure your CLIENT_ID and CLIENT_SECRET and you are all set.
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const CLIENT_ID = '<your client ID>'
const CLIENT_SECRET = '<your client Secret>'
async function handleRequest(request) {
if (request.method === 'GET') {
return new Response(`$ curl -XPOST -H'Content-Type: application/json' -d'{"code": "<your oauth code>"}' ${request.url}`)
@gr2m
gr2m / octokit_pika_build_setup.md
Last active August 16, 2019 15:42
This is a living document on JavaScript Octokit’s build setup using pika pack and semantic-release on GitHub Actions

Octokit.js build setup using @pika/pack

Install @pika/pack and build plugins

npm install --save-dev @pika/pack @pika/plugin-build-node @pika/plugin-build-web @pika/plugin-ts-standard-pkg

Configuration

Local setup

git clone git@gist.github.com:48ad793b3fb7dbb59bcd696bbf75baee.git github-lock-issue-test
cd github-lock-issue-test
npm install
node github-lock-issue-test.js

Should log

@gr2m
gr2m / list_offlinefirst_posts.graphql
Created July 19, 2017 21:49
With GitHub’s new GraphQL API, you can send a single request to list of files with their content. Try it out on https://developer.github.com/v4/explorer/
{
organization(login: "offlinefirst") {
repository(name: "offlinefirst.org") {
object(expression: "gh-pages:_posts/") {
... on Tree {
entries {
object {
... on Blob {
text
}
@gr2m
gr2m / linked_in_delete_all_messages.js
Created March 2, 2017 20:05
This will delete all your messages on linked in. Run on https://www.linkedin.com/messaging/?trk=nav_utilities_inbox. You are welcome :)
$('[data-control-name=clear_conversation]').each(function(){this.click();$('[data-control-name=clear_conversation_confirm]').click()})

November was a Dev Beaver-kind of month. Lots of development in preparation for the Hoodie Village release. Dale from Appback started working on Hoodie’s Task Module, the last big piece left to finish for Hoodie’s new plugin architecture. Benjamin did not only get 4 pull requests merged, he is also working on enabling app-specific plugins, very soon: hoodiehq/hoodie#637. If you are interested how a plugin will look like, we created an example: https://github.com/hoodiehq/hoodie-plugin-example.

@gr2m
gr2m / find_missing_dependencies.js
Last active September 10, 2016 03:24
A tricky problem with npm package tests is that all devDependencies are present. If a package that is needed is only defined as devDependencies then tests will pass, but it will break when required by another package.
// It could be done more elegantly, instead of using glob it could walk the
// relative dependencies, so it would be more flexible and could actually
// be turned into a package that could be run before publishing to npm
var fs = require('fs')
var detective = require('detective')
var glob = require('glob')
var _ = require('lodash')
var buildinModuleNames = require('builtin-modules/static')

Hello, OSCON Contribute!

Come prepared

If you just want to play around with Hoodie, you can take our Hoodie Camp Tutorial and check out our Tracker App and it’s uber-simple source code.

If you want to contribute art, code, design, documentation or editorial work, the basic requirements are

  1. A GitHub account
    GitHub is not only where Hoodie’s code is hosted, but also our website, blog, documentation and much more. We also use GitHub issues for general discussions.

I will give a talk on semantic-release and Greenkeeper this Thursday at Node.js Boston. I want to live-demo publishing packages, update workflows and an accidental breaking change and how Greenkeeper helps with that. I’m looking for a good "story" for what these packages do, how to call them, etc. Any idea? Please ping me on Twitter

Outline

Goal: create a CLI tool / app with a dependency and a sub dependency.

  • Show quickly who to publish all 3 tools with semantic-release