Skip to content

Instantly share code, notes, and snippets.

View desulaid's full-sized avatar
:octocat:
<_<

Anton Styazhkin desulaid

:octocat:
<_<
View GitHub Profile
USE [Test]
GO
/****** Object: Table [dbo].[Autorization] Script Date: 11.03.2020 12:22:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Autorization](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Login] [varchar](50) NOT NULL,
@desulaid
desulaid / server.py
Created December 1, 2019 16:48
Flask
from flask import Flask
from flask import request
from json import dumps
from flask import Response
app = Flask(__name__)
messages = dict()
message_id = 0
@desulaid
desulaid / instagram.py
Created October 7, 2019 14:44
Get photos by hashtag
from requests import get
from json import loads
def get_instagram_media(hashtag):
url = f'https://www.instagram.com/explore/tags/{hashtag}/?__a=1'
data = get(url).text
data = json.loads(data)
data = data['graphql']['hashtag']['edge_hashtag_to_top_posts']['edges']
return [i['node']['thumbnail_src'] for i in data]
from requests import get
from lxml import html
from openpyxl.workbook import Workbook
from openpyxl.styles import Font
from re import findall
BASE_URL = 'https://kiportal.ru'
PAGE_START, PAGE_FINISH = 20, 21
wb = Workbook()
@desulaid
desulaid / main.py
Created May 19, 2019 13:15
SAVE VK PHOTOS
from vk_api import api
vk = api(YOUR_ACCESS_TOKEN)
album = vk.get_photos_from_album(VK_ID, ALBUM_ID/saved/profile/wall, COUNT)
vk.save_photos(album, DIRECTORY)
#!/usr/bin/env python3
from requests import get
from json import dumps
from json import loads
from cgi import FieldStorage
class InstagramHashtag:
def __init__(self, hashtag):
url = 'https://www.instagram.com/explore/tags/{0}/?'.format(hashtag)
@desulaid
desulaid / build.bat
Last active April 1, 2019 23:20
Compile a SAMP mod
@echo off
set gamemode_name=%1
set gamemode_directory=%cd%
set gamemode_complier_path=%gamemode_directory%\complier
set gamemode_path=%gamemode_directory%\gamemodes\%gamemode_name%
title I'll compile your gamemode :)
cd %gamemode_complier_path%
pawncc.exe %gamemode_path%.pwn -d2 -iinclude -o%gamemode_path%.amx -;+
#ifndef INI_HPP
#define INI_HPP
#include <map>
#include <regex>
#include <string>
#include <fstream>
#include <iostream>
class ini_document {
@desulaid
desulaid / *.cpp
Last active April 1, 2019 23:04
SAMP dialog plugin
#include "plugin.hpp"
/*
* Plugin functions
*/
bool Plugin::Load(void **ppData) {
pAMXFunctions = ppData[PLUGIN_DATA_AMX_EXPORTS];
sampgdk::Load(ppData);
sampgdk::logprintf(" Plugin %s v%s by %s has been loaded",
@desulaid
desulaid / sublime-settings.js
Last active April 1, 2019 23:00
Sublime Text 3 - Preferences
{
"bold_folder_labels": true,
"caret_extra_width": 2,
"caret_style": "smooth",
"color_scheme": "Packages/ayu/ayu-light.sublime-color-scheme",
"fade_fold_buttons": false,
"font_face": "Inconsolata",
"font_size": 10,
"highlight_line": true,
"highlight_modified_tabs": true,