Skip to content

Instantly share code, notes, and snippets.

@mihalt
mihalt / main.py
Created November 6, 2024 07:58
mutual_contacts_finding
from typing import List
from skpy import SkypeUtils, SkypeConnection, Skype as OriginalSkype
from skpy.user import SkypeContacts, SkypeUser as OriginalSkypeUser
@SkypeUtils.initAttrs
class SkypeUser(OriginalSkypeUser):
attrs = OriginalSkypeUser.attrs + ('mutual_friend_count',)
defaults = dict(OriginalSkypeUser.defaults, mutual_friend_count=0)
import json
from django.contrib import admin
from django.contrib.admin import ModelAdmin
from django.contrib.contenttypes.fields import GenericForeignKey
from django.db.models import Q, ForeignKey, ManyToManyField
from django.utils.html import mark_safe
from nested_admin.nested import NestedTabularInline
from communications.forms import MessageAdminForm
@mihalt
mihalt / synology-media.yml
Created February 25, 2024 19:20 — forked from Romancha/synology-media.yml
Synology Sonarr + Radarr + Jackett + qBittorrent under OpenVPN
---
version: "2"
services:
qbittorrent:
image: linuxserver/qbittorrent:4.5.0
container_name: qbittorrent
mem_limit: 3000m
mem_reservation: 128M
depends_on:
- openvpn
@mihalt
mihalt / pytest_fixtures.py
Created October 17, 2022 15:13
not_seen_currency_obj_by_django_fixtures
@pytest.fixture
def generate_keys(self, key_factory):
product_obj = Product.objects.get(pk=self.product_in_order_pk)
return lambda **kwargs: key_factory.create_batch(self.product_in_order_quantity, product=product_obj, **kwargs)
@pytest.fixture
def created_default_keys(self, generate_keys, internal_order):
return generate_keys(from_product_in_order__internal_order=internal_order,
from_product_in_order__internal_order__currency=Currency.objects.get(name="USD"))
@mihalt
mihalt / tasks.py
Created May 19, 2022 13:59
planning of architecture
@shared_task
def get_provider_api_stocks(api_key, url_constructor, deserialize_constructor):
return True
def get_one_game_detail_stock():
return True
def get_codes_from_order():
@mihalt
mihalt / webpack.config.js
Last active April 24, 2019 15:21
How to import one from styl files to all others
const webpack = require('webpack');
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const BundleTracker = require('webpack-bundle-tracker');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
entry: {
home: './frontend_src/js/home.js',