This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Callable | |
from django.utils.module_loading import import_string | |
from django.views import View | |
class LazyView: | |
""" | |
Wrapper for view class that can be used for urls to avoid loading the view class at the import time. | |
The view is imported at first access and cached. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from unittest import suite | |
from unittest.suite import BaseTestSuite | |
from django.test.runner import DiscoverRunner | |
from getenv import env | |
def test_key(suite): | |
if isinstance(suite, BaseTestSuite): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import random | |
from django.contrib.auth.decorators import login_required | |
from django.utils.cache import patch_response_headers | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import cache_page, never_cache | |
from django.views.decorators.csrf import csrf_exempt | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# virtualenv-auto-activate.sh | |
# | |
# Installation: | |
# Add this line to your .bashrc or .bash-profile: | |
# | |
# source /path/to/virtualenv-auto-activate.sh | |
# | |
# Go to your project folder, run "virtualenv .venv", so your project folder | |
# has a .venv folder at the top level, next to your version control directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adb shell am start -a android.intent.action.VIEW -d https://www.google.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git branch --merged | grep -v "\*" | grep -v master | xargs -n 1 git branch -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Radio select toggler | |
* enables radio buttons to be toggled when clicked | |
* Created by Michal on 09/05/2016. | |
*/ | |
var radios = $('input[type=radio]'); | |
/** | |
* Adds click listeners to all checkboxes to unselect checkbox if it was checked already |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from django.apps import apps | |
from django.conf import settings | |
from django.core.management.base import BaseCommand | |
from django.db import connections | |
from django.db.migrations.autodetector import MigrationAutodetector | |
from django.db.migrations.executor import MigrationExecutor | |
from django.db.migrations.state import ProjectState | |
from django.db.utils import OperationalError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
San Andreas vehicle model definitions | |
Convoy Trucking | |
Source: http://gta.wikia.com/Vehicle_ID_List | |
*/ | |
#if defined _VEHICLE_MODELS_INCLUDED | |
#endinput | |
#endif |