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 python | |
import asyncio | |
import re | |
import time | |
import aiohttp # pip install aiohttp | |
from bs4 import BeautifulSoup # pip install beautifulsoup4 | |
async def get_response_text(url): | |
async with aiohttp.ClientSession() as session: |
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
replied = set() | |
@client.on(events.NewMessage) | |
async def greet(event: events.NewMessage.Event): | |
chat_room = await client.get_entity(event.chat_id) | |
if event.message.is_group and not event.message.from_id in replied: | |
sender = await event.message.get_sender() | |
text = 'hi' | |
replied.add(event.message.from_id) | |
await client.send_message(chat_room, text) |
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
#views.py | |
from rest_framework import generics, permissions | |
from portofool_io.serializers import UserProfileSerializer | |
class Registration(generics.CreateAPIView): | |
serializer_class = UserProfileSerializer | |
permission_classes = (permissions.AllowAny,) | |
# serializers.py |
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
from pprint import pprint | |
class E: | |
R = [1, 2, 3, 4] | |
C = [] | |
D = [] | |
def get_mc(self): | |
self.C = self.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
##################### models.py | |
from django.db import models | |
class BlogModel(models.Model): | |
name = models.CharField(max_length=32) | |
##################### serializers.py | |
from rest_framework import serializers |
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
-Xms128m | |
-Xmx4096m | |
-XX:MaxMetaspaceSize=512m | |
-XX:MetaspaceSize=512m | |
-XX:ReservedCodeCacheSize=512m | |
-XX:+UseParNewGC | |
-XX:ParallelGCThreads=4 | |
-XX:MaxTenuringThreshold=1 | |
-XX:SurvivorRatio=8 | |
-XX:+UseCodeCacheFlushing |
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 static java.lang.Class.forName; | |
import static java.sql.DriverManager.getConnection; | |
import java.sql.*; | |
import java.util.*; | |
public class db { | |
private static final String JDBC_DRIVER; | |
private static final String DATABASE_URL; |
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 pascal{ | |
public static void main(String[] args) { | |
java.util.Scanner reader = new java.util.Scanner(System.in); | |
System.out.print("Enter some number: "); | |
int ns = reader.nextInt(); | |
for (int n = 0; n < ns; n++) { | |
for (int j = 0; j < (ns * 3) - (n * 7 / 2) + (ns / 3); j++) { | |
System.out.print(" "); | |
} | |
int nCk = 1; |
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 Replace { | |
public static void main (String[] args) throws java.lang.Exception { | |
Map<String, String> map = new HashMap<String, String>(); | |
//n?kfv-=xa. | |
map.put("a", "n"); | |
map.put("b", "?"); | |
map.put("c", "k"); | |
map.put("d", "f"); | |
map.put("e", "v"); | |
map.put("f", "-"); |