This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = require('cheerio') | |
var fs = require('fs') | |
var walker = require('folder-walker') | |
var transform = require('parallel-transform') | |
var ndjson = require('ndjson') | |
var walk = walker('./pageblobs') // generated by abstract-blob-store | |
var scraper = transform(10, scrape) | |
var out = ndjson.serialize() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react' | |
import {connect} from 'react-redux' | |
class App extends Component { | |
render() { | |
console.log(this.props) | |
return( | |
<div> | |
Ajax pending: {this.props.pending.toString()} | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// output of above script pipe into here, converts it to smaller csv | |
var split = require('split2') | |
var through = require('through2') | |
console.log('doi,url') | |
var splitter = split() | |
var each = through(function (buf, enc, next) { | |
var _ | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import ResizeObserver from "resize-observer-polyfill"; | |
import shallowEqual from "fbjs/lib/shallowEqual"; | |
export default class PausableMeasure extends React.Component { | |
node = null; | |
state = {bounds: null}; | |
componentWillMount() { | |
if (!this.props.dontMeasure) this.setup(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request') | |
var link = process.argv[2] | |
var start = process.argv[3] | |
if (!start) start = 0 | |
else start = +start | |
dl(link, start, function (err) { | |
if (err) throw err | |
console.error('All done') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ReactUpdates from 'react-dom/lib/ReactUpdates' | |
import ReactDefaultBatchingStrategy from 'react-dom/lib/ReactDefaultBatchingStrategy' | |
import 'isomorphic-fetch' | |
const logError = (err, extra = {}) => { | |
fetch('/logger', { | |
method: 'POST', | |
credentials: 'same-origin', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(1); | |
(_ => console.log(2))(); | |
eval('console.log(3);'); | |
console.log.call(null, 4); | |
console.log.apply(null, [5]); | |
new Function('console.log(6)')(); | |
Reflect.apply(console.log, null, [7]) | |
Reflect.construct(function(){console.log(8)}, []); | |
Function.prototype.apply.call(console.log, null, [9]); | |
Function.prototype.call.call(console.log, null, 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Jest Electron Runner', function() { | |
it('has access to the window', function() { | |
expect(window).toEqual(global) | |
}) | |
it('has access to the document', function() { | |
expect(document).toEqual(global.document) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!(function(){ | |
var original = console; | |
Object.defineProperty(window, 'console', { | |
get:function(){ | |
return original; | |
}, | |
set:function(value){ | |
original.log(value) | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, PropTypes } from 'react' | |
import elliptic, { eddsa as EdDSA } from 'elliptic' | |
function toHex(arr) { | |
return elliptic.utils.toHex(arr).toUpperCase() | |
} | |
function fromHex(hex) { | |
return elliptic.utils.toArray(hex, 'hex') |