Skip to content

Instantly share code, notes, and snippets.

View RX14's full-sized avatar

Stephanie Wilde-Hobbs RX14

View GitHub Profile
@RX14
RX14 / ghrecentrepos.user.js
Created May 22, 2020 17:03 — forked from maxpowa/ghrecentrepos.user.js
recent repos on sidebar
// ==UserScript==
// @name Github Chronological Repo List
// @namespace https://gist.github.com/maxpowa/d3eb439b990fbee8cff2ae45d726c834
// @description Bring back chronological repo list on the github home page
// @include https://github.com/
// @version 0.0.2
// @require https://openuserjs.org/src/libs/sizzle/GM_config.js
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
@RX14
RX14 / json_with_annotations.cr
Last active May 4, 2018 23:32 — forked from asterite/json_with_annotations.txt
How JSON serialization would look like if Crystal had user-defined annotations like Java/C#
require "spec"
require "json"
require "uuid"
require "uuid/json"
require "big/json"
module JSON
annotation SerializableAnnotation
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", "")
@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 / 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.
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}"
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
@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
}
},
{
@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 / 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"