Skip to content

Instantly share code, notes, and snippets.

@thuanpham582002
thuanpham582002 / google_translate.py
Created November 10, 2022 10:22
google_translate
# coding:utf-8
# author LuShan
# version : 1.1.9
import json
# import urllib3
import logging
import random
import re
import requests
from urllib.parse import quote
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active August 8, 2024 13:26
Install v2ray on Bridge:(Ubuntu +18 via systemd) - Upstream (Ubuntu +18/CentOS +7 via docker)

پنل x-ui

پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور

mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
 -v $PWD/cert/:/root/cert/ \
@Googlefan256
Googlefan256 / gas.js
Created September 3, 2022 13:53
Gasでgoogle translateを自動言語検知ありで使えるやつです
function translate(text, from = "auto", to) {
try {
const result = UrlFetchApp.fetch(
"https://translate.google.com/_/TranslateWebserverUi/data/batchexecute",
{
payload:
"f.req=" +
encodeURIComponent(
JSON.stringify([
[
@PierBover
PierBover / worker.js
Created September 14, 2021 23:37
Cloudflare Worker audio streaming from Backblaze B2
const cache = caches.default;
addEventListener("fetch", (event) => {
try {
const request = event.request
return event.respondWith(handleRequest(event))
} catch (e) {
return event.respondWith(new Response("Error thrown " + e.message))
}
});
@yusufpapurcu
yusufpapurcu / main.py
Created May 6, 2021 10:41
Get last 1 hour of telegram chat with python and telethon
from telethon import TelegramClient
from datetime import datetime, timedelta, timezone
# These example values won't work. You must get your own api_id and
# api_hash from https://my.telegram.org, under API Development.
api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'
client = TelegramClient('anon.session', api_id, api_hash) # You need run twice because this part create session in first run.
client.start()
@lpierron
lpierron / config.json
Created April 26, 2021 17:34
Configuration files for Coqui-TTS
{
"characters":{"pad": "_", "eos": "~", "bos": "^", "characters": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!'(),-.:;? ", "punctuations": "!'(),-.:;? ", "phonemes": "iyɨʉɯuɪʏʊeøɘəɵɤoɛœɜɞʌɔæɐaɶɑɒᵻʘɓǀɗǃʄǂɠǁʛpbtdʈɖcɟkɡqɢʔɴŋɲɳnɱmʙrʀⱱɾɽɸβfvθðszʃʒʂʐçʝxɣχʁħʕhɦɬɮʋɹɻjɰlɭʎʟˈˌːˑʍwɥʜʢʡɕʑɺɧʲɚ˞ɫ"},
"github_branch":"* v0.0.12.lp",
"model": "Tacotron2",
"run_name": "mailabs-fr-ddc",
"run_description": "tacotron2 French MaiLABS with DDC and differential spectral loss. Insipred from en-ljspeech-tacotron2-ddc for Vocoder HifiGan2",
// AUDIO PARAMETERS
"audio":{
// stft parameters
{
"train":[
{
"personality":[
"My name is Ethan. <<REAL PERSONALITY>> This list defines the character, you can add char related text for chat here to drive chat"
],
"utterances":[
{
"candidates":[
"A line character is not supposed to say in this chat.",
@paultopia
paultopia / zotero_add.py
Created April 4, 2020 21:18
hacking together zotero magic add
import requests
import json
import os
from copy import deepcopy
APIKEY = os.environ["ZOTEROKEY"]
ACCOUNT = os.environ["ZOTEROACCOUNT"]
TESTITEM = '10.2307/4486062' # just the same example item used on https://github.com/zotero/translation-server
def get_item_from_identifier(identifier):
endpoint = "http://zotglitch.glitch.me/search"
@sdesalas
sdesalas / Async.gs
Last active August 23, 2024 11:43
Asynchronous execution for Google App Scripts (gas)
/*
* Async.gs
*
* Manages asyncronous execution via time-based triggers.
*
* Note that execution normally takes 30-60s due to scheduling of the trigger.
*
* @see https://developers.google.com/apps-script/reference/script/clock-trigger-builder.html
*/
@painor
painor / FastTelethon.py
Last active September 10, 2024 16:35
This will increase the download/upload speed when using telethon
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py
# Copyright (C) 2021 Tulir Asokan
import asyncio
import hashlib
import inspect
import logging
import math
import os
from collections import defaultdict
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO