Skip to content

Instantly share code, notes, and snippets.


Miroslav Shubernetskiy miki725

View GitHub Profile
View pyclean
if [ -z $path ]; then
# when symlinks are present -delete cannot be used
# by passing all found files to rm via xargs
# allows to remove files even inside symlinks
miki725 / .bashrc
Created Jul 12, 2014
ubuntu bashrc
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
miki725 /
Created Jan 26, 2015
addition to PyCharm Django Console to load Django models
from import no_style
from import import_objects
locals().update(import_objects({'dont_load': []}, no_style()))
from __future__ import unicode_literals, print_function
from django.db import models
class UniqueTogetherModel(models.Model):
foo = models.IntegerField()
bar = models.IntegerField()
class Meta(object):
unique_together = ('foo', 'bar')
View sqrl.reg
Windows Registry Editor Version 5.00
"URL Protocol"=""
miki725 / nginx
Last active Oct 4, 2015
service script for nginx
View nginx
#! /bin/sh
# Based on the following script
# Author: Ryan Norbauer's
# Modified: Geoffrey Grosenbach
# Modified: Clement NEDELCU
set -e
DESC="nginx daemon"
miki725 /
Last active Oct 4, 2015
Creating self-signed ssl certificates for nginx
#! /bin/bash
# Steps are taken from
# To use, sudo priviledges are need (to copy the certificate
# and key to /etc/ssl/)
# The script has one required argument - the name of the certificate
# to be generated. Once the script starts running, just follow
# on-screen instructions.
import requests
account_id = ''
application_id = ''
api_endpoint = ''
response = requests.get(
auth=requests.auth.HTTPBasicAuth(account_id, application_id)
View as_sql.diff
--- import datetime
+++ (clipboard)
@@ -113,7 +113,22 @@
for val in six.itervalues(self.query.extra_select):
- result = ['SELECT']
+ result = []
+ is_subquery = False
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import inspect
from importlib import import_module
import click
click.disable_unicode_literals_warning = True