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 std = @import("std"); | |
| // NOTE: In smart contract context don't really have to free memory before execution ends | |
| var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); | |
| var allocator = arena.allocator(); | |
| // Import host functions provided by NEAR runtime. | |
| // See https://github.com/near/near-sdk-rs/blob/78c16447486285fd952765ef3e727e16d6c8c867/near-sdk/src/environment/env.rs#L117 | |
| extern fn input(register_id: u64) void; | |
| extern fn read_register(register_id: u64, ptr: u64) void; |
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
| // ==UserScript== | |
| // @name GitHub Repo Size | |
| // @namespace https://gist.github.com/miraclx/aad03f43fe8ac85682b0243f4f242f0d | |
| // @description Calculate repo size and inject into GitHub page | |
| // @icon https://github.githubassets.com/favicons/favicon.png | |
| // @version 0.2.0 | |
| // @author miraclx | |
| // @license Apache-2.0 | |
| // @supportURL https://gist.github.com/miraclx/aad03f43fe8ac85682b0243f4f242f0d | |
| // @grant GM_xmlhttpRequest |
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 make_invalid_model(model_class, **kwargs): | |
| """ | |
| create a model object bypassing all member validation | |
| :param model_class: the class of the generated model that needs to be instantiated | |
| :param kwargs: all the model parameters, as they would be passed to the constructor | |
| :return: an instance of model_class | |
| """ | |
| def get_default_values(model_class, attributes): | |
| signature = inspect.signature(model_class.__init__) |
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
| while { | |
| let x = foo(); | |
| bar(x); | |
| x != 0 | |
| } {} | |