Skip to content

Instantly share code, notes, and snippets.

@astrarudra
astrarudra / whatsapp-delete-ads-business-chats.js
Last active July 1, 2024 01:16
WhatsApp - Delete Ads/Business Chats (No App, No Root - Only Browser) - This script deletes all business chats from WhatsApp Web. It is useful since most business chats are spam and are not useful. This script is to be run in the console of the WhatsApp Web page.
/*
Author: Rudra Roy
Tutodial/Demo: https://www.youtube.com/watch?v=KsMNGolq-Fs
Description:
This script deletes all business chats from WhatsApp Web.
It is usefulsince most business chats are spam and are not useful.
This script is to be run in the console of the WhatsApp Web page.
*/
const contextMenuEvent = new MouseEvent("contextmenu", {
@lewangdev
lewangdev / default.custom.yaml
Last active November 13, 2024 07:47
雾凇拼音自定义配置,MacOS-like & Wechat-like Dark/Light Color Scheme For Rime
patch:
# 菜单
menu:
page_size: 8 # 候选词个数
# alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ] # 修改候选项标签
# alternative_select_keys: ASDFGHJKL # 如编码字符占用数字键,则需另设选字键
# ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
# 中西文切换
#
# 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。
@python273
python273 / app.py
Last active November 16, 2024 20:35
Flask Streaming Langchain Example
import os
os.environ["OPENAI_API_KEY"] = ""
from flask import Flask, Response, request
import threading
import queue
from langchain.chat_models import ChatOpenAI
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.schema import AIMessage, HumanMessage, SystemMessage
@blackbing
blackbing / fetchStream.js
Last active September 1, 2024 08:05
Server Sent Event with fetch stream
const url = 'https://api.example.com/v1/sse';
const accessToken = 'test';
fetch(url, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})
.then(response => {
if (response.ok && response.body) {
reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
@sh3l6orrr
sh3l6orrr / TCA_zh.md
Last active October 9, 2024 03:22
TCA

The Composable Architecture (可组装架构)

The Composable Architecture (简写为TCA) 让你用统一、便于理解的方式来搭建应用程序,它兼顾了组装,测试,以及功效。你可以在 SwiftUI,UIKit,以及其他框架,和任何苹果的平台(iOS、macOS、tvOS、和 watchOS)上使用 TCA。

class FloatingPanel: NSPanel {
init(contentRect: NSRect, backing: NSWindow.BackingStoreType, defer flag: Bool) {
// Not sure if .titled does affect anything here. Kept it because I think it might help with accessibility but I did not test that.
super.init(contentRect: contentRect, styleMask: [.nonactivatingPanel, .resizable, .closable, .fullSizeContentView], backing: backing, defer: flag)
// Set this if you want the panel to remember its size/position
// self.setFrameAutosaveName("a unique name")
// Allow the pannel to be on top of almost all other windows
@fhefh2015
fhefh2015 / CustomDashedView.swift
Created June 24, 2021 02:03
CustomDashedView
//
// DashedBorderView.swift
// AInOne
//
// Created by Apple on 2021/6/23.
//
import UIKit
class DashedBorderView: UIView {
@meddokss
meddokss / Styled-components-error.md
Last active August 18, 2024 17:33
[Styled-components Error] Warning: React does not recognize the prop on a DOM element. #STYLED
Warning: React does not recognize the `isEditing` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `isediting` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in button (created by ForwardRef(Tab))
    in ForwardRef(Tab) (created by Context.Consumer)
    in StyledComponent (created by Styled(Component))
    in Styled(Component) (at App.js:14)

In the TextBox component you're passing all the props from the parent via {...props}. Considering that TextField itself doesn't have 'isEditing' property, I assume it passes it down to the underlying input DOM element, which doesn't recognise that prop.