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
// ==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== |
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 "spec" | |
require "json" | |
require "uuid" | |
require "uuid/json" | |
require "big/json" | |
module JSON | |
annotation SerializableAnnotation | |
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", "") |
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
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
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
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
[ | |
{ | |
"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 "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
//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" |
NewerOlder