Skip to content

Instantly share code, notes, and snippets.

View RX14's full-sized avatar

Stephanie Wilde-Hobbs RX14

View GitHub Profile
@RX14
RX14 / build.gradle
Last active August 29, 2015 14:22 — forked from anonymous/build.gradle
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
}
@RX14
RX14 / build.gradle
Last active August 29, 2015 14:26 — forked from Caellian/build.gradle
Cuchaz m3l build script
import groovy.json.JsonSlurper
import java.nio.file.Files
//Project data
String minecraftVersion = "1.8.3",
dirLib = "lib",
dirNatives = "natives/${minecraftVersion}"
//Minecraft data
@RX14
RX14 / build.gradle
Last active August 29, 2015 14:26 — forked from Caellian/build.gradle
Finished?
//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"
@RX14
RX14 / gamemanj-irctadv.cr
Last active September 20, 2015 14:39
CR-TCPServ
require "socket"
require "./gamemanj-irctadv/*"
serv = TCPServer.new(6667)
loop do
socket = serv.accept
spawn GameConnection.new(socket).run
end
@RX14
RX14 / spawn_bonus_chest.json
Last active October 19, 2015 17:59 — forked from Dinnerbone/spawn_bonus_chest.json
This is an example of the current spawn bonus chest loot table in Minecraft, in the (possibly) new loot table data format.
[
{
"item": "minecraft:stick",
"weight": 10,
"minecraft:set_count": {
"min": 1,
"max": 3
}
},
{
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
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}"
@RX14
RX14 / video_file.cr
Last active September 19, 2016 19:55
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.
@RX14
RX14 / alisp.cr
Last active December 16, 2017 18:12 — forked from simenge/alisp.cr
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
@RX14
RX14 / cr1.cr
Last active January 1, 2018 17:40 — forked from kingsleyh/cr1.cr
crystal
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", "")