Skip to content

Instantly share code, notes, and snippets.

View om2c0de's full-sized avatar
🖋️
Innovating

Alexandr Skripkin om2c0de

🖋️
Innovating
View GitHub Profile
@om2c0de
om2c0de / controller.py
Created September 4, 2020 16:47
Patched controller vega
import json
import logging
from http import HTTPStatus
from typing import Awaitable, Optional, Union
from auth.exceptions import UserNotFound
from auth.jwt_utils import jwt_decode
from services.projects import Projects
from services.users import User, Users
from utils.constants import BaseErrorCodes
import React from 'react'
import {Switch, Route, BrowserRouter, Redirect} from 'react-router-dom'
import { Provider, useSelector } from 'react-redux'
import store from 'store/initStore'
import Login from 'scenes/Login/LoginForm'
import ProjectListPage from 'scenes/ProjectListPage'
import CreateProject from 'scenes/ProjectListPage/CreateProject'
import Editor from 'scenes/Editor'
import Calculation from 'scenes/Calculation'
import DataTable from 'scenes/DataTable'
@om2c0de
om2c0de / unsubmodule.md
Created September 2, 2020 09:06 — forked from ryaninvents/unsubmodule.md
Convert git submodule to regular directory

From Stack Overflow.

# Fetch the submodule commits into the main repository
git remote add submodule_origin git://url/to/submodule/origin
git fetch submodule_origin

# Start a fake merge (won't change any files, won't commit anything)
git merge -s ours --no-commit submodule_origin/master
@om2c0de
om2c0de / kerberos.py
Created July 17, 2020 09:25
Kerberos + JWT + Basic + Negotiate authentications using tornado web framework.
import base64
import json
import logging
import os
import sys
from abc import ABC
import jwt
import tornado.escape
import tornado.httpserver
@om2c0de
om2c0de / kerberos.py
Created July 8, 2020 12:51
Tornado + Kerberos + Microsoft Active Directory 100% working module with python3 compatibility.
import base64
import logging
import os
import sys
from abc import abstractmethod
from typing import Optional, Awaitable
import tornado.escape
import tornado.httpserver
import tornado.ioloop
@om2c0de
om2c0de / krb.py
Created July 6, 2020 09:04
Kerberos + Tornado sso auth implementation.
import base64
import logging
import os
import sys
from abc import abstractmethod
from typing import Optional, Awaitable
import tornado.escape
import tornado.httpserver
import tornado.ioloop
@om2c0de
om2c0de / mixins.py
Created July 6, 2020 08:34
Kerberos auth mixin for tornado
import base64
import logging
import os
import sys
from abc import abstractmethod
from typing import Optional, Awaitable
# Platform-specific Kerberos requirements
if sys.platform == 'win32':
import kerberos_sspi as kerberos
@om2c0de
om2c0de / handler.py
Created July 6, 2020 08:34
KerberosAuthHandler
import logging
import sys
from abc import abstractmethod
from typing import Optional, Awaitable
import tornado.escape
import tornado.ioloop
import tornado.web
from .mixins import KerberosAuthMixin
@om2c0de
om2c0de / remove_sl_icon.sh
Created March 1, 2020 10:40 — forked from ulasozguler/remove_sl_icon.sh
Remove spotlight icon from menu bar.
cd /System/Library/CoreServices/Spotlight.app/Contents/MacOS
sudo cp Spotlight Spotlight.bak
sudo perl -pi -e 's|(\x00\x00\x00\x00\x00\x00\x47\x40\x00\x00\x00\x00\x00\x00)\x42\x40(\x00\x00\x80\x3f\x00\x00\x70\x42)|$1\x00\x00$2|sg' Spotlight
cmp -l Spotlight Spotlight.bak
sudo codesign -f -s - Spotlight
sudo killall Spotlight
@om2c0de
om2c0de / json_schemed_field.py
Created January 30, 2020 12:45 — forked from Bahus/json_schemed_field.py
Django JSONField with Pydantic schema support
from functools import partial
import pydantic
import logging
from django.contrib.postgres.fields import JSONField
from typing import Type, Union, Tuple
from django.core.serializers.json import DjangoJSONEncoder