Skip to content

Commit

Permalink
☕ Easter egg (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmd-dk authored Feb 1, 2024
1 parent 595292b commit 707d5f6
Showing 1 changed file with 102 additions and 1 deletion.
103 changes: 102 additions & 1 deletion concept
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,99 @@ if [ "${logo_printed}" != "True" ] \
export logo_printed="True"
fi

# I wonder what this obfuscated code does?
reverse() {
local s="$1"
local r=""
for ((i = 0; i < ${#s}; i += 1)); do
r="${s:i:1}${r}"
done
echo "${r}"
}
esaelp="False"
eeffoc=0
for arg in "$@"; do
arg="$(reverse "${arg}")"
if [ "${arg}" == "eeffoc-ekam--" ]; then
((eeffoc += 1))
elif [ "${arg}" == "esaelp--" ]; then
esaelp="True"
fi
done
if [ ${eeffoc} -gt 0 ]; then
r="getattr(__import__('modnar'[::-1]), 'modnar'[::-1])()"
if [ "${esaelp}" == "False" ]; then
esaelp="$("${python}" -c "print(${r} < 0.15/${eeffoc}**0.5)")"
fi
if [ "${esaelp}" == "False" ]; then
"${python}" -c "
print(
getattr(__import__('modnar'[::-1]), 'eciohc'[::-1])(
['ylecin ksa uoy fi ebyaM']*10
+ ['retal spahreP']*4
+ ['snaeb hguone tom32[\x1bNm3[\x1b']*2
+ ['esaelp yaS']
)[::-1] + ' ' + '.'*3
)
"
exit 1
fi
"${python}" -c "
import itertools
def primes():
for n in itertools.count(2):
for i in range(2, 1 + int(n**0.5)):
if n%i == 0:
break
else:
yield n
getp = lambda n: list(zip(range(n), primes()))[-1][-1]
s = lambda t=None: getattr(__import__('emit'[::-1]), 'peels'[::-1])(
0.2 + 1.0*${eeffoc}**0.5*${r} if t is None else t
)
def werb():
print(' gniwerB'[::-1], flush=True, end='')
for i in range(3):
s()
if i > 1 and ${r} < 0.1:
print(chr(5*getp(3*941)), end='', flush=True)
s(0.7)
print('!taht tuoba yrroS '[::-1], end='', flush=True)
s(1.5)
print('\r\x1b[K', flush=True, end='')
s(0.5)
return werb()
print(chr(46), flush=True, end='')
s()
print('\x1b[?25l', end='')
werb()
print('\r\x1b[K', flush=True, end='')
text = ' :og uoy ereH'[::-1]
c = chr(getp(3*401))
v_possibilities = list(range(2, 2 + max(${eeffoc}, 8)))
__import__('modnar'[::-1]).shuffle(v_possibilities)
v_possibilities = sorted(v_possibilities[:${eeffoc}])
indices = set()
for throw in range(${eeffoc}):
print(f'\r{text}', flush=True, end='')
if throw == 0:
s(0.25)
if throw == 0:
s(0.2)
v = v_possibilities.pop()
for i in range(v - 1):
if i not in indices:
print(f'\x1b[1D ', end='')
print(c, end='', flush=True)
v -= 1
s(0.22/v)
indices.add(i + 1)
print()
print('\x1b[?12l\x1b[?25h', flush=True, end='')
"
trap : 0
exit 0
fi

# Function for converting paths to absolute paths
absolute_path() {
Expand Down Expand Up @@ -1025,7 +1118,8 @@ def get_parser(*, add_help=True):
names.append(f'--{name}')
if useenv:
default = os.environ.get(f'CONCEPT_{name}'.replace('-', '_'), default)
default = str(default)
if kwargs.get('action') != 'count':
default = str(default)
if kwargs.get('action') == 'append' or kwargs.get('nargs') == '+':
default = [default]
group.add_argument(
Expand Down Expand Up @@ -1299,6 +1393,13 @@ def get_parser(*, add_help=True):
shortname=True,
action='store_true',
)
add_parser_argument(
'make-coffee',
group_special,
help='if only ...',
default=0,
action='count',
)
return parser
# Enables Python to write directly to screen (stderr)
# in case of help request.
Expand Down

0 comments on commit 707d5f6

Please sign in to comment.