Mistři v programování na #hovnokod

Tohle jsou změny v gitu jednoho 4 letého iOS developera, jelikož jeho PR neobsahoval nic jiného a zápis isBig a isSmall je stejně dlouhý.

// Diff changes:
// OLD:

if isSmall {
retrun smallSize
} else {
retuen bigSize

// NEW:

if isBig {
retrun bigSize
} else {
retuen smallSize




Jak volit nejjednodušeji měsíc pro API call

enum class Month {
    @SerializedName("January") January,
    @SerializedName("February") February,
    @SerializedName("March") March,
    @SerializedName("April") April,
    @SerializedName("May") May,
    @SerializedName("June") June,
    @SerializedName("July") July,
    @SerializedName("August") August,
    @SerializedName("September") September,
    @SerializedName("October") October,
    @SerializedName("November") November,
    @SerializedName("December") December,


Neřešte co to dělá, rozjímejte nad komentářem..

If it was hard to write, it should be hard to read, but I'll add a small hint
about what it does anyway, to spoil the challenge.

So, take the provided restrict option. If it is not there, fall back to guessing
from the current URI of the script. However, take only the protocol and host
part and convert it into a pattern (without anchors, they are added during
the match).

local restrict = extra.restrict or script_uri:match('^[^:]+:/*[^/]+'):gsub('[%^%$%(%)%%%.%[%]%*%+%-%?]', '%%%0') .. "/.*"