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
class LingvaTranslator { | |
// URL of your instance of LingvaTranslate | |
apiPath = "https://lingva.ml"; | |
translate = (text, from, to) => { | |
return fetch(`${this.apiPath}/api/v1/${from}/${to}/${text}`, { | |
credentials: "omit", | |
headers: { | |
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:99.0) Gecko/20100101 Firefox/99.0", | |
Accept: "*/*", |
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
<div> | |
<img class="heartbeat" src="https://via.placeholder.com/150"/> | |
</div> | |
/*heartbeat*/ | |
.heartbeat | |
{ | |
border-radius: 50%; | |
box-shadow: 0px 5px 10px red; |
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
@SpringBootApplication | |
public class GrpcDemoApplication implements CommandLineRunner { | |
@Autowired | |
private HelloServiceGrpc.HelloServiceImplBase helloServiceGrpc; | |
@Autowired | |
private UsernamePasswordAuthenticator usernamePasswordAuthenticator; | |
public static void main(String[] args) { |
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
source = [11, 8, 3, 9, 7, 1, 2, 5, 13, 6, 8] | |
def merge(left, right): | |
temp = [0] * (len(left) + len(right)) | |
idx_l = 0 | |
idx_r = 0 | |
for i in range(len(temp)): | |
if idx_l >= len(left): | |
for k in range(i, i + len(right) - idx_r): |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import os | |
from MyQR.mylibs import theqrmodule | |
from PIL import Image | |
# Positional parameters | |
# words: str | |
# |
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
arr = [5, 2, 4, 6, 1, 3] | |
for i in range(1, len(arr) + 1): | |
for j in reversed(range(1, i)): | |
if arr[j - 1] > arr[j]: | |
print("before = ", arr) | |
arr[j - 1], arr[j] = arr[j], arr[j - 1] | |
print("after = ", arr) | |
print("\n") |
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
import pyperclip | |
def copy_to_clipboard(command: str): | |
pyperclip.copy(str(command)) | |
if __name__ == '__main__': | |
copy_to_clipboard("Hello, world!") | |
copied_str = pyperclip.paste() | |
print(copied_str) # Hello, world! |