conversations listlengths 2 3 | source stringclasses 1 value | stack stringclasses 1 value |
|---|---|---|
[
{
"from": "system",
"value": "Create the bin directory in the travis build\n"
},
{
"from": "human",
"value": "require \"./spec_helper\"\n\ndescribe Interpreter do\n it \"runs the spec suite\" do\n\n # Build the interpreter\n Process.run(\"crystal\", [\n \"build\",\n \"src/charly... | crystal | chosen |
[
{
"from": "system",
"value": "Add default lang to layout\n\nCloses #46\n"
},
{
"from": "human",
"value": "class MainLayout\n include LuckyWeb::Page\n include LuckyWeb::Layout\n\n @page : BasePage\n\n render do\n html_doctype\n\n html do\n head do\n utf8_charset\n tit... | crystal | chosen |
[
{
"from": "system",
"value": "Add a mapping for gateway packets\n"
},
{
"from": "human",
"value": "require \"json\"\n\nmodule Discordcr\n module REST\n # A response to the Get Gateway REST API call.\n struct GatewayResponse\n JSON.mapping(\n url: String\n )\n end\n en... | crystal | chosen |
[
{
"from": "system",
"value": "Set the Authorization header to the token\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings\"\n\nmodule Discordcr\n module REST\n SSL_CONTEXT = OpenSSL::SSL::Context::Client.new\n\n def request... | crystal | chosen |
[
{
"from": "system",
"value": "test: Validate independent parts instead of the whole output\n"
},
{
"from": "human",
"value": "require \"./../spec_helper\"\n\ndescribe M3U8::Playlist do\n describe \"when creating a playlist\" do\n let(playlist) { M3U8::Playlist.new }\n\n it \"inserts the b... | crystal | chosen |
[
{
"from": "system",
"value": "Add safety constraints to Pointer\n"
},
{
"from": "human",
"value": "struct Pointer(T)\n def +(other : Int)\n self + other.to_i64\n end\n\n def []=(offset, value)\n (self + offset).value = value\n end\nend"
},
{
"from": "gpt",
"value": "struct ... | crystal | chosen |
[
{
"from": "system",
"value": "Add extensions for implicit loading\n"
},
{
"from": "human",
"value": "require \"./tree.cr\"\n\nmodule Crustache\n abstract class FileSystem\n abstract def load(value : String) : Tree::Template?\n\n def load!(value : String) : Tree::Template\n if tmpl = ... | crystal | chosen |
[
{
"from": "system",
"value": "Add a basic MockRequest for mocking a HTTP::Request"
},
{
"from": "human",
"value": "class MockRequest < HTTP::Request\n def initialize\n\n end\nend\n"
},
{
"from": "gpt",
"value": "class MockRequest\n\n def initialize\n end\n\n def get(path : Strin... | crystal | chosen |
[
{
"from": "system",
"value": "Expire session when browser is closed\n"
},
{
"from": "human",
"value": "AMBER_PORT = ENV[\"PORT\"]? || 3008\nAMBER_ENV = ENV[\"AMBER_ENV\"]? || \"development\"\n\nrequire \"amber\"\nrequire \"./initializers/*\"\n\nAmber::Server.instance.config do |app|\n app_path... | crystal | chosen |
[
{
"from": "system",
"value": "Fix a bug that FileSystem can't create instance\n"
},
{
"from": "human",
"value": "require \"./crustache/*\"\n\nmodule Crustache\n # :nodoc:\n OPEN_TAG = \"{{\".to_slice\n # :nodoc:\n CLOSE_TAG = \"}}\".to_slice\n\n def self.parse(string : String, filename = \"... | crystal | chosen |
[
{
"from": "system",
"value": "Add a mapping for the GUILD_EMOJI_UPDATE dispatch payload\n"
},
{
"from": "human",
"value": "require \"./converters\"\nrequire \"./user\"\nrequire \"./channel\"\n\nmodule Discord\n module Gateway\n struct ReadyPayload\n JSON.mapping(\n v: UInt8,\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Remove the fiber spawn in request\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings\"\nrequire \"./version\"\n\nmodule Discord\n module REST\n SSL_CONTEXT = OpenSSL::SSL::Context::Client.new\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Add === override to Int\n"
},
{
"from": "human",
"value": "struct Int\n def <<(count) unsafe_shl count end\n def >>(count) unsafe_shr count end\n def /(other : Int)\n if other == 0\n self\n end\n unsafe_div other\n end\n ... | crystal | chosen |
[
{
"from": "system",
"value": "test: Add scenario with empty line between header and the rest\n"
},
{
"from": "human",
"value": "require \"./../spec_helper\"\n\ndescribe M3U8::MasterPlaylist do\n context \"when rendering a playlist\" do\n let(streams) { [ M3U8::MasterPlaylist::Stream.new(\"lo... | crystal | chosen |
[
{
"from": "system",
"value": "Add a mapping for the GUILD_DELETE payload\n"
},
{
"from": "human",
"value": "require \"./converters\"\nrequire \"./user\"\nrequire \"./channel\"\n\nmodule Discord\n module Gateway\n struct ReadyPayload\n JSON.mapping(\n v: UInt8,\n user: User... | crystal | chosen |
[
{
"from": "system",
"value": "Add support for channel caching\n"
},
{
"from": "human",
"value": "require \"./mappings/*\"\n\nmodule Discord\n class Cache\n def initialize(@client : Client)\n @users = Hash(UInt64, User).new\n end\n\n def resolve_user(id : UInt64) : User\n @use... | crystal | chosen |
[
{
"from": "system",
"value": "Remove colorize from common exception handler\n"
},
{
"from": "human",
"value": "class Kemal::CommonExceptionHandler < HTTP::Handler\n INSTANCE = new\n\n def call(context)\n begin\n call_next context\n rescue ex : Kemal::Exceptions::RouteNotFound\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Use a local variant of the websocket to avoid the not_nil! checks\n"
},
{
"from": "human",
"value": "require \"http/web_socket\"\n\nrequire \"./rest\"\n\nmodule Discordcr\n class Client\n include REST\n\n def initialize(@token : String, @client_id : UInt64)\n... | crystal | chosen |
[
{
"from": "system",
"value": "Add spec for missing else in case statement\n"
},
{
"from": "human",
"value": "require \"../spec_helper\"\n\ndescribe Crow do\n it \"should convert simple case statements\" do\n crystal = <<-CR\n value = \"foo\"\n case value\n when \"foo\"\n p \"ye... | crystal | chosen |
[
{
"from": "system",
"value": "Fix a bug in Indexable(T)\nThis fixes a bug where calling `Indexable(T).[]?` wouldn't compile.\n\nSigned-off-by: Splitty <e8820feff88402cc56882fceaf96271e952e1a96@gmail.com>\n"
},
{
"from": "human",
"value": "module Indexable(T)\n abstract def size\n abstract def ... | crystal | chosen |
[
{
"from": "system",
"value": "Add class method to simplify boot\n"
},
{
"from": "human",
"value": "require \"./hooks_dsl\"\nrequire \"./config_dsl\"\n\nmodule Soil\n class App\n extend HooksDSL\n extend RoutingDSL\n extend ConfigDSL\n\n @@namespace = \"\"\n @@before_hooks = [] of... | crystal | chosen |
[
{
"from": "system",
"value": "Use render method instead of block in app skeleton\n"
},
{
"from": "human",
"value": "abstract class MainLayout\n include LuckyWeb::HTMLPage\n include Shared::FieldErrorsComponent\n include Shared::FlashComponent\n\n # You can put things here that all pages need... | crystal | chosen |
[
{
"from": "system",
"value": "Make exposures work with latest LuckyWeb\n"
},
{
"from": "human",
"value": "abstract class BaseAction < LuckyWeb::Action\n include LuckyWeb::Exposeable\n\n macro inherited\n # If something should always be exposed to your pages, expose them here.\n #\n # ... | crystal | chosen |
[
{
"from": "system",
"value": "Fix a syntax error in the request parameters\n"
},
{
"from": "human",
"value": "require \"http/client\"\n\nmodule Discordcr\n module REST\n def request(endpoint_key : Symbol, method : String, url: String | URI, headers : HTTP::Headers | Nil, body : String | Nil)... | crystal | chosen |
[
{
"from": "system",
"value": "Remove an unnecessary not_nil! from SnowflakeConverter\n"
},
{
"from": "human",
"value": "require \"json\"\nrequire \"time/format\"\n\nmodule Discord\n module SnowflakeConverter\n def self.from_json(parser : JSON::PullParser) : UInt64\n str = parser.read_st... | crystal | chosen |
[
{
"from": "system",
"value": "Fix bug with wrong variable name in Hero.cr\n"
},
{
"from": "human",
"value": "module Dota\n module API\n class Hero\n include Utilities::Mapped\n extend Utilities::Mapped\n\n getter id : Int8 | Int32, name : String\n private getter internalN... | crystal | chosen |
[
{
"from": "system",
"value": "Add missing require in Amber integration\n"
},
{
"from": "human",
"value": "module Raven\n # ```\n # require \"raven/integrations/amber\"\n # ```\n #\n # It's recommended to enable `Configuration#async` when using Amber.\n #\n # ```\n # Raven.configure do |c... | crystal | chosen |
[
{
"from": "system",
"value": "Fix for the 031aff... commit\n\n"
},
{
"from": "human",
"value": "require \"./nekogirls-cr/*\"\nrequire \"kemal\"\n\nKemal.config.port = 8080\nKemal.config.public_folder = \"./src/public/\"\nKemal.config.host_binding = \"localhost\"\n\nmodule Nekogirls\n get \"/\" ... | crystal | chosen |
[
{
"from": "system",
"value": "Add type requirements to all the endpoint methods\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings/*\"\nrequire \"./version\"\n\nmodule Discord\n module REST\n SSL_CONTEXT = OpenSSL::SSL::Context... | crystal | chosen |
[
{
"from": "system",
"value": "Fix compatibility with Crystal 0.34 stdlib\n"
},
{
"from": "human",
"value": "module Scry\n module EnvironmentConfig\n private enum EnvVars\n CRYSTAL_CACHE_DIR\n CRYSTAL_PATH\n CRYSTAL_VERSION\n CRYSTAL_LIBRARY_PATH\n CRYSTAL_OPTS\n e... | crystal | chosen |
[
{
"from": "system",
"value": "Add session and flash handlers\n\nCloses #61\n"
},
{
"from": "human",
"value": "require \"./app\"\n\nserver = HTTP::Server.new(\"127.0.0.1\", 8080, [\n LuckyWeb::HttpMethodOverrideHandler.new,\n HTTP::LogHandler.new,\n LuckyWeb::ErrorHandler.new(action: Errors::S... | crystal | chosen |
[
{
"from": "system",
"value": "Set to development before_each spec\n"
},
{
"from": "human",
"value": "require \"spec\"\nrequire \"../src/kemal/*\"\n\ninclude Kemal\n"
},
{
"from": "gpt",
"value": "require \"spec\"\nrequire \"../src/kemal/*\"\n\ninclude Kemal\n\nSpec.before_each do\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Improve messaging when SEND_GRID_KEY is missing\n"
},
{
"from": "human",
"value": "BaseEmail.configure do\n if Lucky::Env.production?\n send_grid_key = ENV.fetch(\"SEND_GRID_KEY\")\n settings.adapter = Carbon::SendGridAdapter.new(api_key: send_grid_key)\n el... | crystal | chosen |
[
{
"from": "system",
"value": "Disable query logging for `crystal spec`\n"
},
{
"from": "human",
"value": "require \"spec\"\n\nmodule GraniteExample\n ADAPTERS = [\"pg\",\"mysql\",\"sqlite\"]\n @@model_classes = [] of Granite::ORM::Base.class\n\n extend self\n\n def model_classes\n @@model... | crystal | chosen |
[
{
"from": "system",
"value": "Write a test for SnowflakeArrayConverter\n"
},
{
"from": "human",
"value": "require \"./spec_helper\"\n\nstruct StructWithSnowflake\n JSON.mapping(\n data: {type: UInt64, converter: Discord::SnowflakeConverter}\n )\nend\n\nstruct StructWithMaybeSnowflake\n JSO... | crystal | chosen |
[
{
"from": "system",
"value": "Clean up code and add comments\n"
},
{
"from": "human",
"value": "ch1 = Channel(String).new(16)\n\ngcfile = File.new(\"Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa\")\n\nspawn do\n gcfile.each_line() do |line|\n ch1.send(line)\n end\n ch1.close\nend\n\nat = 0... | crystal | chosen |
[
{
"from": "system",
"value": "Implement a very basic request method\n"
},
{
"from": "human",
"value": "module Discordcr\n module REST\n end\nend\n"
},
{
"from": "gpt",
"value": "require \"http/client\"\n\nmodule Discordcr\n module REST\n def request(endpoint_key : Symbol, metho... | crystal | chosen |
[
{
"from": "system",
"value": "Handle PUT and DELETE methods\n\nCloses #29\n"
},
{
"from": "human",
"value": "require \"./app\"\nrequire \"colorize\"\n\nserver = HTTP::Server.new(\"127.0.0.1\", 8080, [\n HTTP::ErrorHandler.new,\n HTTP::LogHandler.new,\n LuckyWeb::RouteHandler.new,\n HTTP::Sta... | crystal | chosen |
[
{
"from": "system",
"value": "Add a REST method to send a message\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings\"\n\nmodule Discordcr\n module REST\n SSL_CONTEXT = OpenSSL::SSL::Context::Client.new\n\n def request(endpo... | crystal | chosen |
[
{
"from": "system",
"value": "Update the Crystal example for Crystal 0.31.0\n"
},
{
"from": "human",
"value": "require \"./sdl.cr/src/sdl\"\nrequire \"./sdl.cr/src/image\"\n\nSDL.init(SDL::Init::VIDEO)\nat_exit { SDL.quit }\nwindow = SDL::Window.new(\"Hello, World!\", 620, 387)\n\nSDL::IMG.init(... | crystal | chosen |
[
{
"from": "system",
"value": "Remove redundant transpile(content : String)\n"
},
{
"from": "human",
"value": "module Crow\n module Basic\n private def transpile(content : String)\n content\n end\n\n private def transpile(node : Crystal::NilLiteral)\n \"undefined\"\n end\n\... | crystal | chosen |
[
{
"from": "system",
"value": "Set Content-Type after call_next in Kemal::InitHandler\n"
},
{
"from": "human",
"value": "module Kemal\n # Kemal::InitHandler is the first handler thus initializes the context with default values such as\n # Content-Type, X-Powered-By.\n class InitHandler < HTTP:... | crystal | chosen |
[
{
"from": "system",
"value": "Send username provided by kemalcr/kemal-basic-auth\n"
},
{
"from": "human",
"value": "require \"http\"\n\nmodule Raven\n module Kemal\n # Exception handler capturing all unhandled `Exception`s.\n # After capturing exception is re-raised.\n #\n # ```\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Remove accidentally included webpack dep\n"
},
{
"from": "human",
"value": "class LuckyCli::Generators::AssetCompiler\n include LuckyCli::GeneratorHelpers\n\n def initialize(@project_name : String)\n @project_dir = File.join(@project_name)\n @template_dir = ... | crystal | chosen |
[
{
"from": "system",
"value": "Add <, > and to_byte_ptr functions to Pointer\n"
},
{
"from": "human",
"value": "struct Pointer(T)\n def +(other : Int)\n self + other.to_i64\n end\n def -(other : Int)\n self - other.to_i64\n end\n def ==(other : Int)\n self == other.to_i64\n end\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Add a nilable email field to the User mapping (for OAuth2)\n"
},
{
"from": "human",
"value": "require \"./converters\"\n\nmodule Discord\n struct User\n JSON.mapping(\n username: String,\n id: {type: UInt64, converter: SnowflakeConverter},\n discr... | crystal | chosen |
[
{
"from": "system",
"value": "Add to_s method for Params\n"
},
{
"from": "human",
"value": "class Params\n\tgetter :hash\n\n\tdef initialize(default=\"\")\n\t\t@params = Hash(String, String).new(default)\n\tend\n\n\tdef hash\n\t\t@params\n\tend\n\n\tdef merge(other : Params)\n\t\tmerged_hash = @... | crystal | chosen |
[
{
"from": "system",
"value": "Use `response.body` instead of `body_io` as the JSON source\n\nOtherwise it will crash with a failed nil assertion.\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings\"\n\nmodule Discordcr\n module RE... | crystal | chosen |
[
{
"from": "system",
"value": "Fix Pointer(T).null? and add Pointer(T).null\n"
},
{
"from": "human",
"value": "struct Pointer(T)\n def +(other : Int)\n self + other.to_i64\n end\n def -(other : Int)\n self - other.to_i64\n end\n def <(other : Pointer(_))\n self < other\n end\n def... | crystal | chosen |
[
{
"from": "system",
"value": "Change endpoints in the app to use the /public directory\n"
},
{
"from": "human",
"value": "#require \"./redis2ws/*\"\nrequire \"kemal\"\nrequire \"redis\"\n\nmodule Redis2ws\n SOCKETS = [] of HTTP::WebSocket\n \n #run redis subscriber in its own fiber\n spawn d... | crystal | chosen |
[
{
"from": "system",
"value": "Add a nilable bot field to User (for bot accounts)\n"
},
{
"from": "human",
"value": "require \"./converters\"\n\nmodule Discord\n struct User\n JSON.mapping(\n username: String,\n id: {type: UInt64, converter: SnowflakeConverter},\n discriminator... | crystal | chosen |
[
{
"from": "system",
"value": "Make sure to put the User initializer at the correct place...\n"
},
{
"from": "human",
"value": "require \"./converters\"\n\nmodule Discord\n # :nodoc:\n def initialize(partial : PartialUser)\n @username = partial.username.not_nil!\n @id = partial.id\n @d... | crystal | chosen |
[
{
"from": "system",
"value": "Return HTTP error 400 if the filename is broken\n\n"
},
{
"from": "human",
"value": "require \"./nekogirls-cr/*\"\nrequire \"kemal\"\n\nKemal.config.port = 8080\nKemal.config.public_folder = \"./src/public/\"\n\nmodule Nekogirls\n get \"/\" do\n \"Hello World\"\... | crystal | chosen |
[
{
"from": "system",
"value": "chore: Use spec2 doc reporter for specs\n"
},
{
"from": "human",
"value": "require \"spec2\"\nrequire \"../src/m3u8\"\n\ninclude Spec2::GlobalDSL\n"
},
{
"from": "gpt",
"value": "require \"spec2\"\nrequire \"../src/m3u8\"\n\ninclude Spec2::GlobalDSL\n\nS... | crystal | chosen |
[
{
"from": "system",
"value": "Check if next handler is present before calling it or a 404 will be triggered by Crystal\n"
},
{
"from": "human",
"value": "module Soil\n module Http\n module Handlers\n class MainHandler\n include HTTP::Handler\n\n def initialize(app_class : ... | crystal | chosen |
[
{
"from": "system",
"value": "Fix wrong filter name in filter documentation\n"
},
{
"from": "human",
"value": "require \"./base\"\n\nmodule Liquid::Filters\n # strip_newlines\n #\n # Removes any newline characters (line breaks) from a string.\n #\n # Input\n # {% capture string_with_newl... | crystal | chosen |
[
{
"from": "system",
"value": "Add a TODO to remind me of the body_io problem\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings\"\n\nmodule Discordcr\n module REST\n SSL_CONTEXT = OpenSSL::SSL::Context::Client.new\n\n def re... | crystal | chosen |
[
{
"from": "system",
"value": "Make sure to convert the heartbeat_interval to an int\n"
},
{
"from": "human",
"value": "require \"http/web_socket\"\nrequire \"json\"\n\nrequire \"./rest\"\n\nmodule Discordcr\n class Client\n include REST\n\n def initialize(@token : String, @client_id : UIn... | crystal | chosen |
[
{
"from": "system",
"value": "Use localhost for the RouteHelper\n\nThis is what you want most of the time, especially when using for callback Urls with OAuth apps"
},
{
"from": "human",
"value": "# This is used when generating URLs for your application\nLucky::RouteHelper.configure do |settings|... | crystal | chosen |
[
{
"from": "system",
"value": "Append newline after nodes with children\n\nSigned-off-by: Leonard Schuetz <0a869347170afd1ee7c6a6a90d899177d625e0cf@me.com>\n"
},
{
"from": "human",
"value": "require \"./TreeVisitor.cr\"\n\nmodule Charly::AST\n\n # Dump a human-readable version of the AST\n clas... | crystal | chosen |
[
{
"from": "system",
"value": "Fix return type restriction since Crystal 0.35.0\n\nFix #27\n"
},
{
"from": "human",
"value": "require \"./parser\"\n\n# :nodoc:\nclass Crustache::IndentIO < IO\n\n def initialize(@indent : String, @io : IO)\n @indent_flag = 0\n @eol_flag = true\n end\n\n d... | crystal | chosen |
[
{
"from": "system",
"value": "Fix `Logger.deansify` not accepting types other than String\n"
},
{
"from": "human",
"value": "require \"logger\"\n\nclass Logger\n private LOGGER_BREADCRUMB_LEVELS = {\n Severity::DEBUG => Raven::Breadcrumb::Severity::DEBUG,\n Severity::INFO => Raven::Bread... | crystal | chosen |
[
{
"from": "system",
"value": "Include the REST module in Client\n"
},
{
"from": "human",
"value": "module Discordcr\n class Client\n def initialize(@token : String, @client_id : UInt64)\n end\n\n def run\n end\n end\nend\n"
},
{
"from": "gpt",
"value": "require \"./rest... | crystal | chosen |
[
{
"from": "system",
"value": "Fix an errant space in the mapping definition\n"
},
{
"from": "human",
"value": "require \"json\"\n\nmodule Discordcr\n module REST\n # A response to the Get Gateway REST API call.\n struct GatewayResponse\n JSON.mapping (\n url: String\n )\n... | crystal | chosen |
[
{
"from": "system",
"value": "Fix RemoveCircularReferences to play nice with types\n"
},
{
"from": "human",
"value": "module Raven\n class Processor::RemoveCircularReferences < Processor\n def process(data, visited = [] of UInt64)\n return data unless data.responds_to? :object_id\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Fix wrong argument usage in HTTPExceptions\n"
},
{
"from": "human",
"value": "module Amethyst\n module Exceptions\n class HttpException < AmethystException\n getter :status\n getter :msg\n\n def initialize(@status, @msg)\n super()\n en... | crystal | chosen |
[
{
"from": "system",
"value": "Disable turbolinks cache by default\n\nCloses #357\n"
},
{
"from": "human",
"value": "class Shared::LayoutHead < BaseComponent\n needs page_title : String\n needs context : HTTP::Server::Context\n\n def render\n head do\n utf8_charset\n title \"My Ap... | crystal | chosen |
[
{
"from": "system",
"value": "Add version information on errors\n"
},
{
"from": "human",
"value": "require \"./franklin\"\nrequire \"option_parser\"\n\nconfig_path = Franklin::Config::DEFAULT_FILE_LOCATION\nfilter_type = nil\n\nparser = OptionParser.parse! { |parser|\n parser.banner = \"Usage: ... | crystal | chosen |
[
{
"from": "system",
"value": "Add CSRF meta tags to layout\n"
},
{
"from": "human",
"value": "abstract class MainLayout\n include Lucky::HTMLPage\n include Shared::FieldErrorsComponent\n include Shared::FlashComponent\n\n # You can put things here that all pages need\n #\n # Example:\n # ... | crystal | chosen |
[
{
"from": "system",
"value": "Make the type field possibly be nil (apparently it is sometimes)\n"
},
{
"from": "human",
"value": "require \"json\"\nrequire \"time/format\"\n\nmodule Discord\n module SnowflakeConverter\n def self.from_json(parser : JSON::PullParser) : UInt64\n str = pars... | crystal | chosen |
[
{
"from": "system",
"value": "Add colours to log messages\n"
},
{
"from": "human",
"value": "require \"logger\"\n\n# Logger #######################################################################\n\nLOG = Logger.new(STDOUT)\nLOG.level = Logger::INFO\nLOG.formatter = Logger::Formatter.new do |sev... | crystal | chosen |
[
{
"from": "system",
"value": "Use Hash composition over inheritance in ValueHash\n"
},
{
"from": "human",
"value": "module Optarg\n # :nodoc:\n abstract class ValueHash(V) < Hash(String, V)\n @fallbacked = {} of String => Bool\n @parser : Parser\n\n def initialize(@parser)\n supe... | crystal | chosen |
[
{
"from": "system",
"value": "Add AddReactions value (1<<6) to Permissions enum\n"
},
{
"from": "human",
"value": "module Discord\n @[Flags]\n enum Permissions : UInt64\n CreateInstantInvite = 1\n KickMembers = 1 << 1\n BanMembers = 1 << 2\n Administrator = 1... | crystal | chosen |
[
{
"from": "system",
"value": "Use the correct method for the request\n"
},
{
"from": "human",
"value": "require \"http/client\"\nrequire \"openssl/ssl/context\"\n\nrequire \"./mappings\"\n\nmodule Discordcr\n module REST\n SSL_CONTEXT = OpenSSL::SSL::Context::Client.new\n\n def request(en... | crystal | chosen |
[
{
"from": "system",
"value": "Use `Crystal::DESCRIPTION` instead of spawning `crystal -v`\n\nMoar efficient, yo\n"
},
{
"from": "human",
"value": "module Raven\n class Context\n # FIXME\n # @[ThreadLocal]\n @@current : self?\n\n def self.current\n @@current ||= new\n end\n\n... | crystal | chosen |
[
{
"from": "system",
"value": "Add a mapping for the GUILD_INTEGRATIONS_UPDATE dispatch payload\n"
},
{
"from": "human",
"value": "require \"./converters\"\nrequire \"./user\"\nrequire \"./channel\"\nrequire \"./guild\"\n\nmodule Discord\n module Gateway\n struct ReadyPayload\n JSON.mapp... | crystal | chosen |
[
{
"from": "system",
"value": "Fix receive on closed chan error\n"
},
{
"from": "human",
"value": "ch1 = Channel(String).new(16)\n\ngcfile = File.new(\"Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa\")\n\nspawn do\n gcfile.each_line() do |line|\n ch1.send(line)\n end\n ch1.close\nend\n\nat =... | crystal | chosen |
[
{
"from": "system",
"value": "Simplify logic just a bit\n"
},
{
"from": "human",
"value": "require \"any_hash\"\n\nrequire \"./raven/ext/*\"\nrequire \"./raven/mixins/*\"\nrequire \"./raven/*\"\n\nmodule Raven\n # `Raven.instance` delegators.\n module Delegators\n delegate :context, :config... | crystal | chosen |
[
{
"from": "system",
"value": "Add a newline to separate text from example code"
},
{
"from": "human",
"value": "abstract class LuckyCli::Task\n macro inherited\n LuckyCli::Runner.tasks << self.new\n\n def name\n \"{{@type.name.gsub(/::/, \".\").underscore}}\"\n end\n end\n\n mac... | crystal | chosen |
[
{
"from": "system",
"value": "Add a rudimentary close handler\n"
},
{
"from": "human",
"value": "require \"http/web_socket\"\n\nrequire \"./rest\"\n\nmodule Discordcr\n class Client\n include REST\n\n def initialize(@token : String, @client_id : UInt64)\n end\n\n def run\n url ... | crystal | chosen |
[
{
"from": "system",
"value": "Clarify what '4' represents in encryption cost"
},
{
"from": "human",
"value": "require \"./server\"\n\nAuthentic.configure do\n settings.secret_key = Lucky::Server.settings.secret_key_base\n\n unless Lucky::Env.production?\n settings.encryption_cost = 4\n end... | crystal | chosen |
[
{
"from": "system",
"value": "Write a test for MaybeSnowflakeConverter\n"
},
{
"from": "human",
"value": "require \"./spec_helper\"\n\nstruct StructWithSnowflake\n JSON.mapping(\n data: {type: UInt64, converter: Discord::SnowflakeConverter}\n )\nend\n\ndescribe Discord do\n describe Discor... | crystal | chosen |
[
{
"from": "system",
"value": "Clean up code and comments\n"
},
{
"from": "human",
"value": "#require \"./redis2ws/*\"\nrequire \"kemal\"\nrequire \"redis\"\n\nmodule Redis2ws\n SOCKETS = [] of HTTP::WebSocket\n puts \"now here\"\n get \"/\" do |ctx|\n send_file ctx, \"src/web/index.html\"\... | crystal | chosen |
[
{
"from": "system",
"value": "Replace cut command with Crystal code"
},
{
"from": "human",
"value": "require \"ecr/macros\"\n\nmodule Artanis\n # TODO: render views in subpaths (eg: views/blog/posts/show.ecr => render_blog_posts_show_ecr)\n module Render\n macro ecr(name, layout = \"layout\... | crystal | chosen |
[
{
"from": "system",
"value": "Optimize CommonLogHandler to directly use the handler instead of string interpolation\n"
},
{
"from": "human",
"value": "require \"http\"\n\nclass Kemal::CommonLogHandler < Kemal::BaseLogHandler\n @handler : IO::FileDescriptor\n getter handler\n\n def initialize(... | crystal | chosen |
[
{
"from": "system",
"value": "Replace -v flag with version in CLI\n"
},
{
"from": "human",
"value": "require \"commander\"\nrequire \"logger\"\n\nrequire \"./crow.cr\"\n\ncli = Commander::Command.new do |cmd|\n cmd.use = \"crow\"\n cmd.long = \"Transpile Crystal to Flow (JS) code.\"\n\n cmd.f... | crystal | chosen |
[
{
"from": "system",
"value": "Add a method to PartialUser to check whether it has all data\n\nRequired to check whether a presence update introduces a new member to the\ncache.\n"
},
{
"from": "human",
"value": "require \"./converters\"\n\nmodule Discord\n struct User\n JSON.mapping(\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Add basic READY handling to the dispatch handler\n"
},
{
"from": "human",
"value": "require \"http/web_socket\"\nrequire \"json\"\n\nrequire \"./rest\"\n\nmodule Discordcr\n class Client\n include REST\n\n def initialize(@token : String, @client_id : UInt64)\... | crystal | chosen |
[
{
"from": "system",
"value": "Add instance types for Crystal 0.16.0\n"
},
{
"from": "human",
"value": "module Kemal::Exceptions\n class RouteNotFound < Exception\n def initialize(context)\n super \"Requested path: '#{context.request.override_method as String}:#{context.request.path}' wa... | crystal | chosen |
[
{
"from": "system",
"value": "Create a mapping for the gateway request response\n"
},
{
"from": "human",
"value": "require \"json\"\n\nmodule Discordcr\n module Mappings\n end\nend\n"
},
{
"from": "gpt",
"value": "require \"json\"\n\nmodule Discordcr\n module REST\n # A respons... | crystal | chosen |
[
{
"from": "system",
"value": "Add missing commands to usage\n"
},
{
"from": "human",
"value": "require \"colorize\"\nrequire \"file_utils\"\nrequire \"option_parser\"\nrequire \"yaml\"\n\nrequire \"./*\"\nrequire \"./commands/*\"\n\nmodule Roadshow\n module CLI\n def self.run(stdin, stdout, ... | crystal | chosen |
[
{
"from": "system",
"value": "Fix the typing for on_message\n"
},
{
"from": "human",
"value": "require \"http/web_socket\"\n\nrequire \"./rest\"\n\nmodule Discordcr\n class Client\n include REST\n\n def initialize(@token : String, @client_id : UInt64)\n end\n\n def run\n url = ... | crystal | chosen |
[
{
"from": "system",
"value": "Add support for exception messages\n\nSigned-off-by: Splitty <e8820feff88402cc56882fceaf96271e952e1a96@gmail.com>\n"
},
{
"from": "human",
"value": "class Exception\n def self.new(message) : NoReturn\n panic\n end\nend\n\nclass TypeCastError < Exception\n def ... | crystal | chosen |
[
{
"from": "system",
"value": "Fix bug in Crystal code\n"
},
{
"from": "human",
"value": "gcfile = File.new(\"Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa\")\n\nat = 0\ngc = 0\n\na = 65_u8\nt = 84_u8\ng = 71_u8\nc = 67_u8\n\ngcfile.each_line() do |line|\n if line.starts_with?('>')\n next\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Return nil from on_message to satisfy the compiler\n"
},
{
"from": "human",
"value": "require \"http/web_socket\"\nrequire \"json\"\n\nrequire \"./rest\"\n\nmodule Discordcr\n class Client\n include REST\n\n def initialize(@token : String, @client_id : UInt64... | crystal | chosen |
[
{
"from": "system",
"value": "Fix naming warning raised by crystal compiler about positional names being mismatched\n"
},
{
"from": "human",
"value": "module Amber::Router::Session\n # All Session Stores should implement the following API\n abstract class AbstractStore\n abstract def id\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Upgrade crystal (needed it to compare output against Clojure code).\n"
},
{
"from": "human",
"value": "def majority_element(elements)\n counts = elements.each_with_object(Hash(String, Int32).new(0)) do |element, collector|\n collector[element] += 1\n collecto... | crystal | chosen |
[
{
"from": "system",
"value": "Add a mapping for permission overwrites\n"
},
{
"from": "human",
"value": "require \"json\"\nrequire \"time/format\"\n\nmodule Discord\n module SnowflakeConverter\n def self.from_json(parser : JSON::PullParser) : UInt64\n str = parser.read_string_or_null\n ... | crystal | chosen |
[
{
"from": "system",
"value": "Fix Client::State exponential backoff logic\n"
},
{
"from": "human",
"value": "module Raven\n class Client::State\n enum Status\n ONLINE\n ERROR\n end\n\n @status : Status\n @retry_number : Int32\n @last_check : Time?\n @retry_after : Ti... | crystal | chosen |
[
{
"from": "system",
"value": "Sort platform repos and add aliases"
},
{
"from": "human",
"value": "module Mnd\n PLATFORMS = {\n \"prime\" => [\n Repo.new(\"mynewsdesk\", color: :cyan),\n Repo.new(\"social-media-monitor\", color: :green),\n Repo.new(\"mnd-audience\", color: :li... | crystal | chosen |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 7