Skip to content

Instantly share code, notes, and snippets.

View clsung's full-sized avatar

Cheng-Lung Sung clsung

View GitHub Profile
@hungte
hungte / megadecrypter.py
Last active January 10, 2025 00:05
A tool to decrypt mega encrypted link, inspired from https://github.com/denysvitali/megadecrypter/ because installing Crystal-lang is not an easy thing for most people.
#!/usr/bin/env python
# Copyright 2018 Hung-Te Lin. All rights reserved.
# Use of this source code is governed by MIT license.
"""A program to decrypt mega://enc2?.... link.
Inspired from https://github.com/denysvitali/megadecrypter
"""
import base64
import binascii
@weihanglo
weihanglo / rust-vs-go.md
Last active July 11, 2025 13:11
【譯】Rust vs. Go

【譯】Rust vs. Go

本文譯自 Julio Merino 2018 年七月撰寫的 Rust vs. Go 一文。Julio Merino 是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。

Thanks Julio Merino for this awesome article!


from langchain.callbacks.base import BaseCallbackHandler
import azure.cognitiveservices.speech as speechsdk
import os
import base64
import time
class StreamDisplayHandler(BaseCallbackHandler):
def __init__(self, container, initial_text="", display_method='markdown'):
self.container = container
self.text = initial_text
self.display_method = display_method