Skip to content

Instantly share code, notes, and snippets.

View straight-shoota's full-sized avatar

Johannes Müller straight-shoota

View GitHub Profile
@straight-shoota
straight-shoota / error-trace.txt
Created January 21, 2022 13:22
Crystal compiler error `--error-trace`
Using /home/linuxbrew/.linuxbrew/bin/llvm-config [version= 13.0.0]
In src/compiler/crystal/program.cr:45:69
 45 | getter splat_expansions : Hash(Def, Type) = ({} of Def => Type).compare_by_identity
^------------------
Error: instantiating 'Hash(Crystal::Def, Crystal::Type)#compare_by_identity()'
In src/hash.cr:976:5
@straight-shoota
straight-shoota / S3 config api
Last active December 14, 2021 22:45
Crystal S3 Config
{
"IndexDocument": {
"Suffix": "index.html"
},
"ErrorDocument": {
"Key": "api/1.2.2/404.html"
},
"RoutingRules": [
{
"Condition": {
@straight-shoota
straight-shoota / executables.md
Last active January 31, 2024 11:58
Shards with `postinstall` scripts or `executables`
@straight-shoota
straight-shoota / diff.diff
Last active August 31, 2021 20:52
Crystal i for linux
diff --git c/src/compiler/crystal/repl/context.cr w/src/compiler/crystal/repl/context.cr
index 1cceb2c45..3451a87d0 100644
--- c/src/compiler/crystal/repl/context.cr
+++ w/src/compiler/crystal/repl/context.cr
@@ -471,8 +472,14 @@ class Crystal::Repl::Context
return unless path && name
- # TODO: obviously support other platforms than darwin
- lib_path = File.join(path, "lib#{name}.dylib")
@straight-shoota
straight-shoota / docs-section.cr
Created March 2, 2021 02:06
crystal docs sections
# Foo class for foo.
#
# # Bar methods
# Bar methods to bary things.
#
# * bar
# * bar?
#
# # Baz methods
# Baz methods to bazy things.
@straight-shoota
straight-shoota / expression_value_comment.cr
Created February 18, 2021 00:09
Formatting expression value comment
# These are the invalid syntax comments extracted from crystal master (at 152e390fb1368fafd5c3d6028f46ee149f0f216a)
# /src/** files using the code from https://github.com/crystal-lang/crystal/pull/8851
# src/hash.cr
{}
{}
# src/regex.cr
Regex::MatchData("tal")
{}
Regex::MatchData("Skiing")
Regex::MatchData("sledding")
@straight-shoota
straight-shoota / range-descending.cr
Created January 8, 2021 17:56
[Crystal] Descending range
struct Range
# Iterates over the elements of this range, passing each in turn to the block.
#
# ```
# (10..15).each { |n| print n, ' ' }
# # prints: 10 11 12 13 14 15
# ```
def each : Nil
{% if B == Nil %}
@straight-shoota
straight-shoota / http.server.log
Created April 10, 2020 15:40
HTTP::Server log of running testssl.sh
E, [2020-04-10T15:38:08.902789000Z #14627] ERROR -- crystal-run-test_ssl_server.tmp:http.server: Error while connecting a new socket -- OpenSSL::SSL::Error: SSL_accept: I/O error
E, [2020-04-10T15:38:09.113485000Z #14627] ERROR -- crystal-run-test_ssl_server.tmp:http.server: Error while connecting a new socket -- OpenSSL::SSL::Error: SSL_accept: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
E, [2020-04-10T15:38:09.323018000Z #14627] ERROR -- crystal-run-test_ssl_server.tmp:http.server: Error while connecting a new socket -- OpenSSL::SSL::Error: SSL_accept: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
E, [2020-04-10T15:38:10.649837000Z #14627] ERROR -- crystal-run-test_ssl_server.tmp:http.server: Error while connecting a new socket -- OpenSSL::SSL::Error: SSL_accept: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
E, [2020-04-10T15:38:10.717875000Z #14627] ERROR -- crystal-run-test_ssl_server.tmp:http.server: Error while connecting a new socket
@straight-shoota
straight-shoota / fix_tls
Created April 9, 2020 12:42
Crystal SSL Server testssl.sh reports
No engine or GOST support via engine with your /usr/bin/openssl
###########################################################
testssl.sh 3.1dev from https://testssl.sh/dev/
(c90bd84fe 2020-04-09 13:59:35 -- )
This program is free software. Distribution and
modification under GPLv2 permitted.
USAGE w/o ANY WARRANTY. USE IT AT YOUR OWN RISK!
@straight-shoota
straight-shoota / Makefile
Last active February 5, 2024 00:21
Makefile for Crystal + Shards
.POSIX:
all:
# Recipes
## Build application
## $ make
## Run tests
## $ make test
## Install application