Skip to content

Instantly share code, notes, and snippets.

Sam Ruby rubys

Block or report user

Report or block rubys

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rubys /
Last active Sep 19, 2018
The menu is omakase

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


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 / first-immediate-child.html
Created Aug 22, 2018
if the first item in a div is an h3, don't put a border on it
View first-immediate-child.html
<!DOCTYPE html>
h3 {border: 1px solid black}
div>h3:first-child {border: none}
<h3>..</h3> <!-- no border on h3 -->
View test-module-import.js
'use strict';
const assert = require('assert');
const { spawn } = require('child_process');
const input = `
(path) => {process.stdout.write(path.delimiter)},
View gist:d6ef21524486edac952f06d2967539f7
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.
View all.json
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": [
View all.diff
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 @@
<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=",700,400italic">
rubys / html.diff
Created Jun 28, 2018
Instrumenting tools/doc/html.js for performance analysis
View html.diff
diff --git a/tools/doc/html.js b/tools/doc/html.js
index 974eab769c..b4153c4eee 100644
--- a/tools/doc/html.js
+++ b/tools/doc/html.js
@@ -53,6 +53,8 @@ function navClasses() {
+let start = new Date().getTime();
rubys / allhtml.js
Created Jun 27, 2018
regex version of allhtml.js
View 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 / allhtml.js
Last active Jun 25, 2018
merge html documentation
View allhtml.js
'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 / heapfailure.js
Created Jun 24, 2018
Processing all runs out of heapspace using remark
View heapfailure.js
'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/';
You can’t perform that action at this time.