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
| local json = require("dkjson") | |
| local data = require("space-age-data") -- https://wiki.factorio.com/Data.raw | |
| local indent = " " | |
| function to_json(item) | |
| return json.encode(item, { indent = true }) | |
| end | |
| function onlyx(items) |
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
| local lib = require("lib") | |
| local groupings = { | |
| { | |
| name = "iron-gear-wheel", | |
| input_item_name = "iron-ore", | |
| options = { | |
| { | |
| name = "iron-plate => iron-gear-wheel", | |
| }, |
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 io | |
| import nbt # sudo python3 -m pip install NBT | |
| import os | |
| class BitReader: | |
| def __init__(self, data, size): | |
| self.data = data | |
| self.size = size |
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
| class Promise2 { | |
| PENDING = 0; | |
| FULFILLED = 1; | |
| REJECTED = 2; | |
| static resolve(value) { | |
| return new Promise2((resolve, reject) => resolve(value)); | |
| } | |
| static reject(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
| const React = {}; | |
| /** | |
| * ReactElements are lightweight objects which contain information necessary to | |
| * create the equivalent DOM nodes. All JSX tags are transformed into functions | |
| * that return instances of this class. | |
| * Note that the decision to actual create those nodes and insert them into the | |
| * document hasn't been made yet: it is possible that that might never happen. | |
| */ |
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
| #!/usr/bin/env node | |
| var fs = require("fs"), path = require("path"); | |
| var run = function(root,start){ | |
| var fs = require("fs"), path = require("path"); // intentionally redefined | |
| var ext = ".js", index = "index"+ext, pkg = "package.json"; | |
| var locate = function(root,name){ | |
| var p = name.split(path.sep); | |
| // all relative module references must be inside the specified directory |
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
| /* | |
| Since the default implementations of the `JSON.stringify` and `JSON.parse` functions do not | |
| support serialization of `Infinity`, `-Infinity`, `NaN`, RegExp instances or circular references | |
| in objects, the following functions can be used when such support is required. | |
| The value `undefined` has been left out given how objects already return the same when the | |
| user tries to access a non-existent key. While there are situations where the presence of the | |
| key itself matters, they are infrequent enough not to have warranted support. |