Skip to content

Instantly share code, notes, and snippets.

@jumasheff
jumasheff / regex_find.py
Created March 4, 2020 10:40
Finds particular string at returns it
import re
l = ['123 м2', '123.43 м2 ывсвсв', None, '']
def t(x):
if x is None:
return ''
m = re.findall('^[-+]?[0-9]*[.,]?[0-9]+\s*м2', x)
if len(m) > 0:
return m[0]
return ''
'<!DOCTYPE html>\n<html lang="en">\n<head>\n <!-- Simple HttpErrorPages | MIT X11 License | https://github.com/AndiDittrich/HttpErrorPages -->\n\n <meta charset="utf-8">\n <meta http-equiv="X-UA-Compatible" content="IE=edge">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n\n <title>Something went wrong | 500 - Webservice currently unavailable</title>\n\n <style type="text/css">/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#
@jumasheff
jumasheff / invoice.json
Created April 18, 2019 11:13
`invoice.payment_failed` payload
{
"created": 1326853478,
"livemode": false,
"id": "evt_00000000000000",
"type": "invoice.payment_failed",
"object": "event",
"request": null,
"pending_webhooks": 1,
"api_version": "2017-04-06",
"data": {
@jumasheff
jumasheff / payment_intent.json
Last active April 18, 2019 10:58
payment_intent.json -- payload
{
"created": 1326853478,
"livemode": false,
"id": "evt_00000000000000",
"type": "payment_intent.payment_failed",
"object": "event",
"request": null,
"pending_webhooks": 1,
"api_version": "2017-04-06",
"data": {
def mult_odd(array):
"""
sums odd-indexes elements and multiply at the last
"""
some_result = 0
return some_result
if __name__ == '__main__':
assert mult_odd([0, 1, 2, 3, 4, 5]) == 45, "(1+3+5)*5=45"
assert mult_odd([1, 3, 5]) == 15, "(3)*5=15"
def second_word(text):
"""
returns the last word in a given text.
"""
some_result = ""
return some_result
if __name__ == '__main__':
print("Example:")
@jumasheff
jumasheff / whatsapp_phone_enumerator_floated_div.js
Created May 12, 2017 11:03
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses (floated div)
/*
PoC WhatsApp enumeration of phonenumbers, profile pics, about texts and online statuses
Floated div edition
01-05-2017
(c) 2017 - Loran Kloeze - loran@ralon.nl
This script creates a UI on top of the WhatsApp Web interface. It enumerates certain kinds
of information from a range of phonenumbers. It doesn't matter if these numbers are part
of your contact list. At the end a table is displayed containing phonenumbers, profile pics,
about texts and online statuses. The online statuses are being updated every
@jumasheff
jumasheff / types.txt
Created November 21, 2016 12:01 — forked from manuelgu/types.txt
Valid action types for the Trello API
CREATE_CARD = "createCard";
COMMENT_CARD = "commentCard";
UPDATE_CARD = "updateCard";
UPDATE_CARD_ID_LIST = "updateCard:idList";
UPDATE_CARD_CLOSED = "updateCard:closed";
UPDATE_CARD_DESC = "updateCard:desc";
UPDATE_CARD_NAME = "updateCard:name";
ADD_MEMBER_TO_CARD = "addMemberToCard";
REMOVE_MEMBER_FROM_CARD = "removeMemberFromCard";
UPDATE_CHECK_ITEM = "updateCheckItemStateOnCard";
@jumasheff
jumasheff / install_docker_python.md
Last active December 26, 2021 04:00
Docker. Official. python 3.5.2-alpine and 3.5.2-slim

Install Docker:

wget -qO- https://get.docker.com/ | sh

Add your username to docker group to run docker commands without sudo:

sudo usermod -aG docker yourusername

Here, logout from your machine (warning: this will close all your active windows).