Run this command to remember your password:
git config --global credential.helper 'cache --timeout 28800'Above command will tell git to cache your password for 8 hours.
| import yaml | |
| from rest_framework.compat import coreapi, urlparse | |
| from rest_framework.schemas import SchemaGenerator | |
| from rest_framework_swagger import renderers | |
| from rest_framework.response import Response | |
| from rest_framework.views import APIView | |
| from rest_framework import exceptions | |
| from rest_framework.permissions import AllowAny |
| from django.views.generic import ListView | |
| class SimpleFilteringListView(ListView): | |
| """ | |
| List view with extra filtering and grouping in context data. | |
| ``filters`` dict is created as follows: {'context_variable_name', 'filtering_object_method_name'} | |
| It calls filtering method on each object in object_list and if it returns True - this object is added | |
| to proper context variable. |
| """ | |
| Gets the name of the active Git branch as a string. | |
| Depends on GitPython | |
| pip install GitPython | |
| """ | |
| from git import Repo | |
| repo = Repo('/path/to/your/repo') | |
| branch = repo.active_branch |
| ########### PYTHON ENV ########### | |
| $ python --version | |
| Python 2.7.9 | |
| $ pip freeze | |
| argh==0.26.1 | |
| boto==2.39.0 | |
| Cython==0.23.4 |
| ########################################################################### | |
| ################# Cannot reproduce with kivy 1.9.O windows portable install # | |
| ########################################################################### | |
| C:\Users\micha\Kivy-1.9.0>python --version | |
| botstrapping Kivy @ C:\Users\micha\Kivy-1.9.0\ with Python C:\Users\micha\Kivy-1.9.0\Python27 | |
| done bootstraping kivy...have fun!\n | |
| running "python.exe --version" \n | |
| Python 2.7.9 |
| // MIT License (MIT) | |
| // | |
| // Copyright (c) 2015. Michael Ewald, GeomaticsResearch LLC. | |
| // | |
| // 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: |
| # - * - coding: UTF-8 - * - | |
| import subprocess | |
| def macosx_set_clipboard(text): | |
| p = subprocess.Popen('pbcopy', stdin=subprocess.PIPE) | |
| p.communicate(text) | |
| def macosx_send_keys(text): | |
| text = text.replace('\\', '\\\\').replace('"', '\\"') |
| from kivy.app import App | |
| from kivy.lang import Builder | |
| from kivy.properties import StringProperty | |
| kv = ''' | |
| BoxLayout: | |
| orientation: 'vertical' | |
| BoxLayout: | |
| size_hint_y: None |
| *.pyc |