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
plugins { | |
id "java" //or scala or groovy | |
id "nova.gradle" version "0.1.0-SNPASHOT" | |
} | |
dependencies { | |
compile "nova.core:NovaCore:0.1.0-SNPASHOT" | |
compile //Some nova plugin | |
} |
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
import groovy.json.JsonSlurper | |
import java.nio.file.Files | |
//Project data | |
String minecraftVersion = "1.8.3", | |
dirLib = "lib", | |
dirNatives = "natives/${minecraftVersion}" | |
//Minecraft data |
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
//Project data | |
String minecraftVersion = "1.8.3", | |
//Mapping data | |
String mappingsCommit = "88962d643ca3912333ede2da1b25d9a1092d5781", | |
//Versions | |
String forgeVersion = "1.8-11.14.1.1334" | |
String enigmaVersion = "0.10.4b" |
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
require "socket" | |
require "./gamemanj-irctadv/*" | |
serv = TCPServer.new(6667) | |
loop do | |
socket = serv.accept | |
spawn GameConnection.new(socket).run | |
end |
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
[ | |
{ | |
"item": "minecraft:stick", | |
"weight": 10, | |
"minecraft:set_count": { | |
"min": 1, | |
"max": 3 | |
} | |
}, | |
{ |
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
require "../flag.cr" | |
class ExecuteFlag < Blerp::CommandFlag | |
@name = :execute | |
@key = "-e" | |
@description = "EXECUTE SOMETHING" | |
def processor(parser, data) | |
command = data.has_key?(:opposite) ? "nothing" : "something" | |
output = MemoryIO.new |
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
require "benchmark" | |
STATUS_CODE = "200" | |
METHOD = "GET" | |
PATH = "api/v1/users" | |
IO = MemoryIO.new(100) | |
Benchmark.ips do |x| | |
x.report "Normal String" do | |
IO << "|#{STATUS_CODE}| #{METHOD} #{PATH}" |
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
module MediaManager | |
class VideoFile | |
CHUNK_SIZE = 64 * 1024 | |
def self.compute_hash(file_path : String) | |
filesize = File.size(file_path) | |
hash = filesize | |
# Read 64 kbytes, divide up into 64 bits and add each | |
# to hash. Do for beginning and end of file. |
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
module Lisp | |
alias Value = Symbol | String | Int64 | Bool | Nil | Builtin | List | |
record Symbol, value : String | |
struct List | |
getter list : Array(Value) | |
def initialize(@list = Array(Value).new) | |
end |
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
def isLoggedIn(context, repo) | |
sessionId = context.session.string?("userId") | |
if sessionId | |
user = repo.findUserByUserId(sessionId) | |
case user | |
when DB::Success | |
groupId = user.value["activeChannel"].as_h.fetch("groupId", "") | |
channelId = user.value["activeChannel"].as_h.fetch("channelId", "") |
OlderNewer