Skip to content

Instantly share code, notes, and snippets.

View Dem0n3D's full-sized avatar

Дмитрий Dem0n3D

  • Оренбург
View GitHub Profile
@ngse
ngse / audit_mixin.py
Last active May 21, 2023 13:56
Rough attempt at implementing an audit log against Flask/Flask Login/SQLAlchemy models
# Requires use of Flask Login for the user tracking
# Implement by using AuditableMixin in your model class declarations
# e.g. class ImportantThing(AuditableMixin, Base):
import json
from flask_login import current_user
from sqlalchemy import event, inspect
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm.attributes import get_history
@denji
denji / README.md
Last active May 16, 2024 10:38 — forked from Cubixmeister/README.md
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000
@alediaferia
alediaferia / tiny_uploader.js
Last active November 27, 2022 01:36
A tiny snippet for reading files chunk by chunk in plain JavaScript
/*
Copyright (c) 2015-2020 Alessandro Diaferia
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@hirokiky
hirokiky / README.md
Created May 19, 2015 08:46
Proxy server by using aiohttp.

Async Proxy Server

Installation

pip install -r requirements.txt

Run

Run the backend server

@inklesspen
inklesspen / post-checkout.py
Created June 10, 2014 21:54
Post-checkout hook to detect alembic issues when switching branches.
#!/usr/bin/env python
"""
Provide useful alembic information after switching branches.
"""
import argparse
import subprocess
import os
import os.path
import py.path
@v12
v12 / yandex-ddns
Last active April 23, 2021 15:24
RouterOS (MikroTik) Yandex DNS subdomain A record updater.
########
# Name: yandex-ddns
# Author: v12
# URL: https://gist.github.com/v12/8892066
########
### Settings section
# There is no way of getting token automatically via script, so you should get it manually: https://pddimp.yandex.ru/get_token.xml?domain_name=example.com
@robulouski
robulouski / gmail_imap_example.py
Last active April 19, 2024 02:27
Very basic example of using Python and IMAP to iterate over emails in a gmail folder/label. http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#!/usr/bin/env python
#
# Very basic example of using Python and IMAP to iterate over emails in a
# gmail folder/label. This code is released into the public domain.
#
# RKI July 2013
# http://www.voidynullness.net/blog/2013/07/25/gmail-email-with-python-via-imap/
#
import sys
import imaplib
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@nichtich
nichtich / README.md
Last active May 20, 2024 07:48 — forked from oodavid/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)