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 re | |
| count = 4 | |
| thing_to_replace = "<T0>" | |
| input = """public static bool HasPersistentListenerMethod<T0>(this UnityEvent<T0> uEvent, UnityAction<T0> action) | |
| { | |
| var methodName = action.Method.Name; | |
| for (int i = 0; i < uEvent.GetPersistentEventCount(); i++) | |
| { |
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
| package validate_israeli_id_module | |
| import ( | |
| "regexp" | |
| "strconv" | |
| "strings" | |
| ) | |
| var( | |
| IDSanitizer = regexp.MustCompile(`^[0-9]{1,9}$`) |
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 random | |
| import csv | |
| def generate_random_israeli_phone_number(): | |
| prefix = random.choice(["050", "052", "053", "054", "055", "058"]) | |
| main = random.randint(0, 9999999) | |
| mainstr = str(main) | |
| mainstr = "0" * (7 - len(mainstr)) + mainstr | |
| complete = prefix + mainstr |
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
| term.clear() | |
| function fluid_transfer(config) | |
| local width, height = term.getSize() | |
| local resIndex = -1 | |
| for k,v in pairs(config) do | |
| resIndex = resIndex + 1 | |
| term.setCursorPos(1, height - (4 + 4 * resIndex)) | |
| print("Fluid storage of '"..k.."'") | |
| for kk,vv in pairs(v["storage"]) do |
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
| package.preload["argparse"] = function(...) | |
| local function errorf(msg, ...) | |
| error(msg:format(...), 0) | |
| end | |
| local function setter(arg, result, value) | |
| result[arg.name] = value or true | |
| end | |
| local parser = { __name = "ArgParser" } | |
| parser.__index = parser | |
| function parser:add(names, arg) |
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
| --os.loadAPI(shell.resolve(".").."/gameutils") | |
| local fuels = { | |
| ["minecraft:coal"] = true | |
| } | |
| local mat_to_color = { | |
| ["minecraft:wheat"] = "1", | |
| ["minecraft:carrots"] = "2", | |
| ["simplefarming:carrot_crop"] = "2", |
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
| DROP TABLE IF EXISTS `messages`; | |
| CREATE TABLE `messages` ( | |
| `_id` INTEGER PRIMARY KEY AUTOINCREMENT, | |
| `key_remote_jid` TEXT NOT NULL, | |
| `key_from_me` INTEGER, | |
| `key_id` TEXT NOT NULL, | |
| `status` INTEGER, | |
| `needs_push` INTEGER, | |
| `data` TEXT, | |
| `timestamp` INTEGER, |
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 LocationUtils{ | |
| public static float computeDistance(double lat1, double lon1, | |
| double lat2, double lon2) { | |
| // Based on http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf | |
| // using the "Inverse Formula" (section 4) | |
| int MAXITERS = 20; | |
| // Convert lat/long to radians | |
| lat1 *= Math.PI / 180.0; | |
| lat2 *= Math.PI / 180.0; |
NewerOlder