Skip to content

Instantly share code, notes, and snippets.

@rubys
rubys / PushEvent.py
Last active September 23, 2018 20:41
Allow git-multimail to run as a webhook for GitHub
#!/usr/bin/python
from __future__ import print_function
#
# A simple CGI script useful for debugging GitHub web hooks
# https://developer.github.com/webhooks/
#
import hashlib, hmac, json, os, sys, traceback
from subprocess import Popen, PIPE, STDOUT
@rubys
rubys / omakase.md
Last active September 19, 2018 23:40
The menu is omakase

Rails doctrine: The menu is omakase (translation: I'll leave it up to you)

Preface

I'm going to try to make the case that instead of focusing on Module requirements, we should focus on Loader requirements and let a thousand flowers bloom. Part of making my case, I will introduce a number of new use cases that may have here-to-fore seemed out of reach.

Parallel Evolution

@rubys
rubys / first-immediate-child.html
Created August 22, 2018 11:09
if the first item in a div is an h3, don't put a border on it
<!DOCTYPE html>
<style>
h3 {border: 1px solid black}
div>h3:first-child {border: none}
</style>
<div>
<h3>..</h3> <!-- no border on h3 -->
<p>....</p>
</div>
'use strict';
require('../common');
const assert = require('assert');
const { spawn } = require('child_process');
const input = `
import('path').then(
(path) => {process.stdout.write(path.delimiter)},
console.log
);
Started by upstream project "node-compile-windows" build number 19474
originally caused by:
Started by upstream project "node-test-commit-windows-fanned" build number 19355
originally caused by:
Started by upstream project "node-test-commit" build number 19846
originally caused by:
Started by upstream project "node-test-pull-request" build number 15917
originally caused by:
Started by user Rich Trott
[EnvInject] - Loading node environment variables.
This file has been truncated, but you can view the full file.
{
"miscs": [
{
"textRaw": "About this Documentation",
"name": "About this Documentation",
"introduced_in": "v0.10.0",
"type": "misc",
"desc": "<p>The goal of this documentation is to comprehensively explain the Node.js\nAPI, both from a reference as well as a conceptual point of view. Each\nsection describes a built-in module or high-level concept.</p>\n<p>Where appropriate, property types, method arguments, and the arguments\nprovided to event handlers are detailed in a list underneath the topic\nheading.</p>\n",
"miscs": [
{
This file has been truncated, but you can view the full file.
--- /Users/rubys/tmp/all.html 2018-06-29 20:42:20.000000000 -0400
+++ out/doc/api/all.html 2018-06-29 20:42:46.000000000 -0400
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
- <title>About this Documentation | Node.js v11.0.0 Documentation</title>
+ <title>Node.js v11.0.0 Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
@rubys
rubys / allhtml.js
Created June 27, 2018 13:20
regex version of allhtml.js
'use strict';
// Build all.html by combining the generated toc and apicontent from each
// of the generated html files.
const fs = require('fs');
const source = `${__dirname}/../../out/doc/api`;
// get a list of generated API documents
@rubys
rubys / allhtml.js
Last active June 25, 2018 13:25
merge html documentation
'use strict';
const fs = require('fs');
const { JSDOM } = require('jsdom');
const source = '../../out/doc/api';
const html_files = fs.readdirSync(source, 'utf8')
.filter((name) => name.includes('.html') && name !== 'all.html');
@rubys
rubys / heapfailure.js
Created June 24, 2018 19:23
Processing all runs out of heapspace using remark
'use strict';
const fs = require('fs');
const processIncludes = require('./preprocess');
const unified = require('unified');
const markdown = require('remark-parse');
const remark2rehype = require('remark-rehype');
const html = require('rehype-stringify');
const inputFile = '../../doc/api/all.md';