Skip to content

Instantly share code, notes, and snippets.

public static class ControlEx
{
public static void Invoke(this System.Windows.Forms.Control @this, Action action)
{
if (@this == null) throw new ArgumentNullException("@this");
if (action == null) throw new ArgumentNullException("action");
if (@this.InvokeRequired)
{
@this.Invoke(action);
}
version: '2'
services:
web:
image: odoo:12.0
depends_on:
- mydb
ports:
- "8069:8069"
environment:
- HOST=mydb
public class Post
{
[XmlRpcMember("post_id")]
public string Id { get; set; }
[XmlRpcMember("post_type")]
public string PostType { get; set; }
[XmlRpcMember("post_title")]
public string Title { get; set; }
@ahvahsky2008
ahvahsky2008 / python send file with requests
Created March 26, 2021 12:36
python send file with requests
def send_request (doc):
with open(doc, 'rb') as file:
post_data = {'chat_id': chat_id}
post_file = {'document': file}
r = requests.post(f'https://api.telegram.org/bot{token}/sendDocument', data=post_data, files=post_file)
print(r.text)
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
class Node:
def __init__(self, name: str, parent: 'Node' = None):
self.name = name
self.parent = parent
self.children = []
def add_child(self, obj: 'Node'):
self.children.append(obj)
@property
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
datatables_list = {
'film_work': FilmWork,
'person': Person,
'person_film_work': PersonFilmWork,
'genre': Genre,
'genre_film_work': GenreFilmWork,
}
for base, schema in datatables_list.items():
from datetime import date, datetime
import uuid
from dataclasses import dataclass, field
{
"doc_info": [
{
"doc_type": "TORG_12",
"pages": [
{
"page_id": "911f6780-3003-4d59-8fe0-e18e7463328a",
"page_orient": 0,
"page_num": 1,
"page_ml": "1",