Skip to content

Instantly share code, notes, and snippets.

View RyanCavanaugh's full-sized avatar
🏃‍♂️
Catching up

Ryan Cavanaugh RyanCavanaugh

🏃‍♂️
Catching up
View GitHub Profile
@RyanCavanaugh
RyanCavanaugh / gist:831f125c7c383477bc51
Created March 4, 2015 19:29
Bookmarklet: Mark commits as read
$('ul.notifications li.commit-notification li.delete button').each(function(i, li) { li.click(); });
@RyanCavanaugh
RyanCavanaugh / gist:591af2615d1e2b8d5d99
Created March 4, 2015 19:31
Bookmarklet: Mark PRs as read
$('ul.notifications li.pull-request-notification li.delete button').each(function(i, li) { li.click(); });
@RyanCavanaugh
RyanCavanaugh / tsserver.js
Created July 7, 2015 16:59
tsserver.js from commit e009d68d6b81e7a18d81
This file has been truncated, but you can view the full file.
var ts;
(function (ts) {
// token > SyntaxKind.Identifer => token is a keyword
(function (SyntaxKind) {
SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown";
SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken";
SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia";
SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia";
SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia";
SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia";
@RyanCavanaugh
RyanCavanaugh / tester.ts
Created July 30, 2015 18:29
Faster DefinitelyTyped test script
/// <reference path="node_modules/typescript/bin/typescriptServices.d.ts" />
/// <reference path="node/node.d.ts" />
import fs = require('fs');
let libdts = 'node_modules/typescript/bin/lib.d.ts';
eval(fs.readFileSync('node_modules/typescript/bin/typescriptServices.js', 'utf-8'));
function runTestFolder(dir: string) {
let files = fs.readdirSync(dir);
@RyanCavanaugh
RyanCavanaugh / script.js
Created October 24, 2016 19:20
Mark as read
var ignames = ["andy-ms", "mhegazy", "vladima"];
var i = 100;
ignames.forEach(function (nm) {
$$('ul.notifications div.avatar-stack img[alt="@' + nm + '"]:first-child').forEach(function(el) {
var e = el.parentNode.parentNode.parentNode;
var b = e.getElementsByClassName("delete")[0].getElementsByTagName("button")[0];
window.setTimeout(function() { b.click(); } , i += 100);
});
});
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'publish',
1 verbose cli '--access',
1 verbose cli 'public' ]
2 info using npm@5.3.0
3 info using node@v8.2.1
4 verbose npm-session 00feed7f2f8e4e80
5 verbose publish [ '.' ]
@RyanCavanaugh
RyanCavanaugh / log.txt
Created March 27, 2018 19:22
Failed NPM install log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm@5.6.0
3 info using node@v8.10.0
4 verbose npm-session 86fc37f069b18b6a
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall express-app57@0.0.0
7 info lifecycle express-app57@0.0.0~preinstall: express-app57@0.0.0
@RyanCavanaugh
RyanCavanaugh / object-keys.md
Last active May 15, 2019 22:52
Breaking Changes 3.5

Object.keys rejects primitives in ES5

Background

In ECMAScript 5 environments, Object.keys throws an exception if passed any non-object argument:

// Throws if run in an ES5 runtime
Object.keys(10);
@RyanCavanaugh
RyanCavanaugh / data.md
Last active July 24, 2019 03:36
30-day Download Counts for @types
Package 30-Day Download Count
node 5953555
jasmine 1364049
q 1342763
lodash 1130666
react 833429
express 817781
jquery 814943
chai 646129