ワンライナー(lambda無し)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lambda **kw:(globals().update(kw),logging.basicConfig(level=logging.INFO),asyncio.set_event_loop(asyncio.new_event_loop()),type('client',(discord.Client,),{'on_ready':asyncio.coroutine(lambda self:print(f'account is {self.user}')),'on_message':asyncio.coroutine(lambda self,msg:asyncio.ensure_future(self.send_message(msg.channel,'pong'))if msg.author != self.user and msg.content == 'ping' else None)})().run('token')))(**{i:__import__(i) for i in ['logging','asyncio','discord']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lambda **kw:[globals().update(kw),logging.basicConfig(level=logging.INFO),asyncio.set_event_loop(asyncio.new_event_loop()),(lambda client:[[(lambda func,name:client.event(asyncio.coroutine(types.LambdaType(func.__code__,globals(),name,None,(func.__closure__)))))(*item) for item in [[(lambda msg:{True:lambda:asyncio.ensure_future(client.send_message(msg.channel,'pong')) if msg.content == 'ping' else None,False:lambda :None}[msg.author != client.user]()),'on_message'],[lambda :print(f'account is {client.user}'),'on_ready']]],client.run('token')])(discord.Client())])(**{i:__import__(i) for i in ['logging','asyncio','discord','types']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import discord | |
import asyncio | |
asyncio.set_event_loop(asyncio.new_event_loop()) | |
client = discord.Client() | |
flg = True | |
origin_send_message = client.send_message | |
client.send_message =lambda *args,**kwargs:(origin_send_message(*args,**kwargs),globals().__setitem__('flg',False))[0] | |
send_message = lambda *args,**kwargs:asyncio.ensure_future(client.send_message(*args,**kwargs)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lambda I=None:[ | |
[ | |
loc['stac'] | |
if not loc['loop'].close() | |
else None | |
for i in loc['loop'] | |
if | |
i == 'end' | |
or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
[ | |
print( | |
glo['RPN'](glo['translate'](glo['text_0']).split(':')) | |
) | |
for i in [''] | |
] for glo in [{}] | |
if not( | |
glo.update({ | |
'text':input('>'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print([next(_ for _ in ((0for _return, _args in iter({'_return':[None], 'args':[]}.values,None)if _args.append((yield _return[0])) or (([[0 for f,*_ in (_args,)for _return[0] in(f()(f,5)[0],)]] and _args.clear()) if _args else None)),) if [next(_)]).send(functools.partial(next,(type('funcsource',tuple(),next(namespace for namespace in ({'_return': ['return']},)for _func in (next(_ for _ in ((0for count, _args in iter({'argcount':2+2, 'args':[]}.values,None)if _args.append((yield (1 if (_args and _args[-1] is namespace['_return']) else 0))) or (([[0 for self, _, f,n in (_args,)for __ in (self._return.clear(),)if self._return.append(1 if n ==1 else f()(f,n-1)[0]*n)]] and _args.clear()) if len(_args)>=count else None)),) if [next(_)]).send,)for namespace['__call__'] in (functools.partialmethod(max,namespace.get('_return'),key = _func),)))() for i in iter(int,1)))) for functools in (__import__('functools'),)][0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
from ctypes import * | |
from pathlib import Path | |
import ui | |
IOMobileFramebufferOpen = c.IOMobileFramebufferOpen | |
IOMobileFramebufferOpen.argtypes = [c_void_p]*4 | |
mach_task_self = c.mach_task_self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import create_objc_class, ObjCInstance, NSObject | |
from textwrap import dedent | |
def objci_new_setattr(self, name, value): | |
if name in ('ptr', 'weakrefs', '_cached_methods', '_as_parameter_'): | |
self.__dict__[name] = value | |
return | |
try: | |
setter_method = getattr(self, 'set%s%s_' % (name[0].upper(), name[1:])) | |
setter_method(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from objc_util import * | |
from objc_util import parse_types | |
import ctypes | |
import editor | |
import time | |
method_exchangeImplementations=c.method_exchangeImplementations | |
method_exchangeImplementations.restype=None | |
method_exchangeImplementations.argtypes=[c_void_p,c_void_p] |
OlderNewer