Skip to content

Instantly share code, notes, and snippets.

@baweaver
Last active July 28, 2017 16:52
Show Gist options
  • Save baweaver/cc0b8aea562366e18bc3 to your computer and use it in GitHub Desktop.
Save baweaver/cc0b8aea562366e18bc3 to your computer and use it in GitHub Desktop.
It happened again with Sinatra this time
# Oh dear god why
___ = (
_ = ' ' =~ /$/ # 10 - apparently EOL match works like that on spaces
) *
_ + # * 10 -> 100
_ + # + 10 -> 110
_ / # + 10 /
(
(__=$$/$$) + # 1
__ # + 1
) # / 2 -> 5
# ___ = 115
$_ = -> &_ { _ }[
&:"#{
'' << # Blank string
___ << # - 115 - s
_ * _ + __ << # 10 * 10 + 1 - 101 - e
_ * _ + _ << # 10 * 10 + 10 - 110 - n
_ * _ # 10 * 10 - 100 - d
}"
] # send as a callable proc
_ = -> __, ___ {
-> _ {
$_[ # send
_,
# So we're sending the argument to tr
'' << # blank string
___ + __ << # 115 + 1 - 116 - t
___ - __, # 115 - 10 - 105 - r
'!"#$%&()*+,.:;@[]^`{|}~', # any special characters transformed to
[*?`..?{][__..-__]*''
] # An array of all letters a to z
}
}[__, ___] # Where we pass in the values of 1 and 115 respectively for a closure
# Send empty string
$_[
'',
_['^%]|*^%'], # require
_['`*;!{^!'] # sinatra
]
$_[ # send alias_method ___ get
$_[ # send owner
$_[ # send method get
$_[ # send binding receiver to String
$_['', _['"*;$*;(']], # binding
_['^%#%*}%^'] # receiver
],
_[':%{)@$'], # method
_['(%{'] # get
],
_['@~;%^'] # owner
],
_['!.*!`_:%{)@$'], # alias_method
:___, # to ___
_['(%{'] # get
]
$__ = [$.>__] # false - 0 > 1
# GET root
___(?/) {
(
@_ = $_[ # send binding receiver
@__ = $_[ # send binding to String
$_[
'',
_['"*;$*;('] # binding
],
_['^%#%*}%^'] # receiver
],
_['[!^!:`'] # params - so get the params from the receiver
][:_]
# If we have params to work with:
) ? (
$_[ # send [false] delete_at (param to_i)
$__, # [false]
_['$%.%{%_!{'], # delete_at
$_[ # send param to_i
@_ , # param
_['{@_*'] # to_i
]
] ||
$__ = # or redefine [false] as
[__ - __ > __] + # 1 - 1 > 1 - [false]
$__ + # + [true]
[@_]; # + param
# not really a linebreak
$_[ # then send string binding receiver redirect to root
@__, # string binding receiver
_['^%$*^%#{'], # redirect to
?/ # / or root
]
) :
# Else we do this
(
@__ = _; # Make this your new translator
# not really a linebreak
(
@_ = -> _, __ = '' {
$__[_] ? # [false]
(
__ <<
@__["<! )^%&=?_=#{_}>✗</!> "] + # "<a href=?_=redirect>✗</a> "
$__[_] +
@__['<"^>'] # <br>
@_[_+_/_,__] # recurse with ???
) :
__
}
)[__] + # ???
@__['<&@^:><*;[|{ ;!:%=_ !|{@&@#|`>'] # "<form><input name=_ autofocus>"
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment