https://github.com/resultsystems/laravel-security-router
This file contains hidden or 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
""" | |
Adds a `seed` paramter to DRF's `next` and `prev` pagination urls | |
""" | |
from rest_framework import serializers | |
from rest_framework import pagination | |
from rest_framework.templatetags.rest_framework import replace_query_param | |
from . import utils | |
This file contains hidden or 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
class MultipleFieldLookupORMixin(object): | |
""" | |
Actual code http://www.django-rest-framework.org/api-guide/generic-views/#creating-custom-mixins | |
Apply this mixin to any view or viewset to get multiple field filtering | |
based on a `lookup_fields` attribute, instead of the default single field filtering. | |
""" | |
def get_object(self): | |
queryset = self.get_queryset() # Get the base queryset | |
queryset = self.filter_queryset(queryset) # Apply any filter backends | |
filter = {} |
This file contains hidden or 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
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |
This file contains hidden or 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
# Install linux update, followed by GCC and Make | |
sudo yum -y update | |
sudo yum install -y gcc make | |
# Install Nginx and php56-FPM | |
sudo yum install -y nginx php56-fpm | |
# Install php56 extensions | |
sudo yum install -y php56-devel php-mysql php56-pdo php56-pear php56-mbstring php56-cli php56-odbc php56-imap php56-gd php56-xml php56-soap |
This file contains hidden or 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 urllib.parse | |
url = "http://stackoverflow.com/search?q=question" | |
params = {'lang':'en','tag':'python'} | |
url_parts = list(urllib.parse.urlparse(url)) | |
query = dict(urllib.parse.parse_qsl(url_parts[4])) | |
query.update(params) | |
url_parts[4] = urllib.parse.urlencode(query) |
This file contains hidden or 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
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
Easy youtrack deployment using docker
These Dockerfiles allow you to easily build images to deploy your own youtrack instance. It's free for up to ten users.
Besides that, as always, use these scripts with care.
This file contains hidden or 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
Code | Category | Subcategory | Description | |
---|---|---|---|---|
1 | Cars & Light 4X4 Utilities | Cars | 2-Door Saloon | |
2 | Cars & Light 4X4 Utilities | Cars | 4-Door Saloon | |
3 | Cars & Light 4X4 Utilities | Cars | Saloon (for information only, no longer used) | |
4 | Cars & Light 4X4 Utilities | Cars | Convertible | |
5 | Cars & Light 4X4 Utilities | Cars | Coupe | |
6 | Cars & Light 4X4 Utilities | Cars | Estate | |
11 | Cars & Light 4X4 Utilities | Cars | Hearse | |
12 | Cars & Light 4X4 Utilities | Cars | Limousine | |
13 | Cars & Light 4X4 Utilities | Cars | 3-Door Hatchback |