Skip to content

Instantly share code, notes, and snippets.

@wldhx
wldhx / main.py
Created March 27, 2024 15:32
telethon/openai event announcement rewriter
import asyncio
import os
import sys
import openai as openai_
import telethon
import telethon.sessions
PROMPT = """
A user gives you a long-form event announcement and you rewrite it to the following template:
@wldhx
wldhx / programming_metaphysics.1-alpha.lhs
Last active June 24, 2017 10:26
goto-school-2017-06.programming_metaphysics.1-alpha
*Programming. The metaphysics way.*, exercises for
==================================================
Class 1-alpha
-------------
We covered lambda calculus, some common operators, defining functions, using `.hs` files and GHCi and just barely scratched data types (GADTs; the `data Bool = False | True` part).
So here are some refreshers and clarifications for that, as well as something to go a bit further on with.
clang-format -style="{BasedOnStyle: google, IndentWidth: 2, ColumnLimit: 200}" *.js -i
text = 'aa bb cc!!!!__'
f = functools.partial(re.sub, '[\W_]+', '')
' '.join(list(map(f, text.split())))
@wldhx
wldhx / python-vs-rust.md
Last active February 7, 2018 15:30
Few trivial code samples contrasting Python and Rust

Python vs. Rust

(For reference: I know why it is the way it is, the stark difference is just kind of fun to contrast on trivial examples.)

Reading from stdin

Python

a = input()
  • плохая математика
  • потребные профессора
  • ты - не говно в глазах администрации
  • нетоксичная атмосфера
  • большая стипендия
  • меньше ебут, чем в "классическом академическом" (ВМК, МФТИ, ...)
  • больше прикладной фокус, чем в КА
  • нет международной аккредитации (решается обменом / магистратурой)
  • не топ в олимпиадном плане (финалистов ACM ICPC среди студентов нет)
  • ты можешь выбить из них деньги на нужную тебе вещь
@wldhx
wldhx / keybase.md
Created March 8, 2016 19:26
Keybase proof

Keybase proof

I hereby claim:

  • I am wldhx on github.
  • I am wldhx (https://keybase.io/wldhx) on keybase.
  • I have a public key ASC1DBDR0bs0YUS58EfNlrAUGZ_zXcemCyRzFRj48NsDdQo

To claim this, I am signing this object:

Инструкция по хождению в облако

Как войти

  1. Заходим на https://everware.rep.school.yandex.net Важно, что именно https://

  2. Нажимаем "Sign In with Github" Если вы не залогинены в Github, появится форма логина/пароля к github, где нужно их ввести

@wldhx
wldhx / gist:859b93d58776e4312c5a
Last active June 7, 2016 23:30
Onename.com verification
Verifying that +wldhx is my blockchain ID. https://onename.com/wldhx