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
| fn tohex(input: &[u8]) -> String { | |
| #[inline] | |
| fn hex(d: u8) -> char { | |
| match d { | |
| 0...9 => (d + 0x30) as char, | |
| 10...15 => (d + 0x57) as char, | |
| _ => unreachable!("unexpected value: {}", d), | |
| } | |
| } |
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
| HikariConfig databaseConfig = new HikariConfig(); | |
| String driverType = config.get("driverType"); | |
| String host = config.get("host"); | |
| String port = config.get("port"); | |
| String database = config.get("database"); | |
| String jdbcUrl = "jdbc:" + driverType + "://" + host + ':' + port + '/' + database; | |
| databaseConfig.setJdbcUrl(jdbcUrl); | |
| databaseConfig.setUsername("root"); |
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 java.security.SecureRandom; | |
| public class TokenGenerator { | |
| private static final char[] TOKEN_CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
| .toCharArray(); | |
| private final int size; | |
| protected SecureRandom random = new SecureRandom(); |
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
| let url = "https://www.google.com/maps/embed/v1/directions?" + | |
| "key=" + mapsApiKey + "&origin=" + origin + "&destination=" + destination; |
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 createWindow () { | |
| [...] | |
| //hide the menu items for fullscreen usage | |
| mainWindow.setMenu(null); | |
| [...] | |
| } | |
| // This method will be called when Electron has finished |
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 java.util.Locale; | |
| public enum OS { | |
| LINUX, | |
| MACOS, | |
| SOLARIS, | |
| WINDOWS, | |
| UNKNOWN; | |
| private OS() { |
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 me.xeroun.mcmmoextras; | |
| import com.mewin.WGCustomFlags.WGCustomFlagsPlugin; | |
| import com.mewin.util.Util; | |
| import com.sk89q.worldguard.bukkit.WorldGuardPlugin; | |
| import com.sk89q.worldguard.protection.flags.EnumFlag; | |
| import com.sk89q.worldguard.protection.flags.SetFlag; | |
| import java.util.Set; |
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/python3 | |
| from blink1.blink1 import Blink1 | |
| import time | |
| COLOR = "ed8106" | |
| COLOR_RGB = struct.unpack('BBB', bytes.fromhex(COLOR)) | |
| # Seconds | |
| FADE_TIME = 500 |
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
| private TextColor getHealthColor(int percent) { | |
| TextColor highlightColor; | |
| switch (percent) { | |
| case 1: | |
| case 2: | |
| highlightColor = TextColors.DARK_RED; | |
| break; | |
| case 3: | |
| case 4: | |
| highlightColor = TextColors.RED; |
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
| # Generated by Cargo | |
| # will have compiled files and executables | |
| /target/ | |
| # IntelliJ | |
| /.idea/ | |
| Rust-Test.iml | |
| out/ |