This file contains 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
#99AAB5 &f | |
#1ABC9C &a | |
#2ECC71 &a | |
#3498DB &9 | |
#9B59B6 &5 | |
#E91E63 &d | |
#F1C40F &e | |
#E67E22 &6 | |
#E74C3C &c | |
#95A5A6 &7 |
This file contains 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 com.scarsz; | |
import java.util.concurrent.TimeUnit; | |
public class Main { | |
public static void main(String[] args) { | |
long millis = TimeUnit.MINUTES.toMillis(37) + TimeUnit.SECONDS.toMillis(19); | |
String message = getDurationBreakdown(millis); | |
System.out.println(message); |
This file contains 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
<?php | |
define("GAME_DIR", "/home/steam/gmod_server/garrysmod"); | |
define("CACHE_DIR", "./fastdl_cache"); // Must be in public folder, and must start with "." | |
define("SCAN_ADDONS", true); | |
define("SCAN_GAMEMODES", true); | |
define("ATTEMPTS_LOG_FILE", "./attempts.log"); | |
$content_dirs = [ | |
"maps", | |
"resource", |
This file contains 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() { | |
var images = [].slice.call(document.querySelectorAll('img')); | |
var urls = []; | |
images.forEach(function(img) { | |
if (!urls.includes(img.src)) urls.push(img.src); | |
}); | |
if (confirm("Download all the things?")) { | |
var link = document.createElement('a'); | |
link.setAttribute('download', ''); |
This file contains 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
#!/bin/bash | |
locationstocompress=( "/home" "/var/www" ) | |
identifier="WEB-1" | |
megaemail="email@provider.com" | |
megapass="password" | |
# Edit below this if you're feeling lucky | |
masterfile="$identifier-$(date +"%Y-%m-%d").tar.gz" |
This file contains 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 github.scarsz; | |
import org.bukkit.Material; | |
import org.bukkit.configuration.serialization.ConfigurationSerialization; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.meta.ItemMeta; | |
import org.yaml.snakeyaml.DumperOptions; | |
import org.yaml.snakeyaml.Yaml; | |
import java.util.HashMap; |
This file contains 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
// create an empty source file | |
File sourceFile = File.createTempFile("Hello", ".java"); | |
sourceFile.deleteOnExit(); | |
// generate the source code, using the source filename as the class name | |
String classname = sourceFile.getName().split("\\.")[0]; | |
String sourceCode = "public class " + classname + "{ public void hello() { System.out.print(\"Hello world\");}}"; | |
// write the source code into the source file | |
FileWriter writer = new FileWriter(sourceFile); |
This file contains 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 int getOnlinePlayers() { | |
try { | |
Method onlinePlayerMethod = Server.class.getMethod("getOnlinePlayers"); | |
if (onlinePlayerMethod.getReturnType().equals(Collection.class)) { | |
return ((Collection<?>) onlinePlayerMethod.invoke(Bukkit.getServer())).size(); | |
} else { | |
return ((Player[]) onlinePlayerMethod.invoke(Bukkit.getServer())).length; | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); |
This file contains 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
public enum PokemonGenerationThreeWithTypes { | |
Bulbasaur(Type.Grass, Type.Poison), | |
Ivysaur(Type.Grass, Type.Poison), | |
Venusaur(Type.Grass, Type.Poison), | |
Charmander(Type.Fire), | |
Charmeleon(Type.Fire), | |
Charizard(Type.Fire, Type.Flying), | |
Squirtle(Type.Water), | |
Wartortle(Type.Water), |
This file contains 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 com.scarsz.playground; | |
import java.util.HashMap; | |
import java.util.LinkedHashMap; | |
import java.util.Map; | |
import java.util.Random; | |
import java.util.concurrent.atomic.AtomicInteger; | |
/** | |
* Made by Scarsz |
OlderNewer