✨ - New feature
👾 - Bugfix
🎨 - UI and style
🔨 - Code refactoring, dependency upgrade, improving code quality
🚧 - Work in progress
| brew cask reinstall vagrant | |
| # this might take a long time | |
| vagrant plugin update |
✨ - New feature
👾 - Bugfix
🎨 - UI and style
🔨 - Code refactoring, dependency upgrade, improving code quality
🚧 - Work in progress
| <div id="messages"> | |
| {% for message in messages %} | |
| <div {% if message.tags %}class="alert alert-dismissable alert-{{ message.tags }}"{% endif %}> | |
| <a class="close" data-dismiss="alert" href="#">×</a> | |
| {{ message }} | |
| </div> | |
| {% endfor %} | |
| </div> |
| import re | |
| emoji_pattern = re.compile( | |
| u"(\ud83d[\ude00-\ude4f])|" # emoticons | |
| u"(\ud83c[\udf00-\uffff])|" # symbols & pictographs (1 of 2) | |
| u"(\ud83d[\u0000-\uddff])|" # symbols & pictographs (2 of 2) | |
| u"(\ud83d[\ude80-\udeff])|" # transport & map symbols | |
| u"(\ud83c[\udde0-\uddff])" # flags (iOS) | |
| "+", flags=re.UNICODE) |
You probably arrived here because of a curt message in response to an issue you filed on a repo that I contribute to. Sorry about that (particularly if you filed the issue long ago and have been waiting patiently for a response). Let me explain:
I work on a lot of different open source projects. I really do like building software that makes other people's lives easier, but it's crazy time-consuming. One of the most time-consuming parts is responding to issues. A lot of OSS maintainers will bend over backwards to try and understand your specific problem and diagnose it, to the point of setting up new test projects, fussing around with different Python versions, reading the documentation for build tools that we don't use, debugging problems in third party dependencies that appear to be involved in the problem... and so on. I've personally spent hundreds of hours of my free time doing these sorts of things to try and help people out, because I want to be a responsible maintainer and
| # Read docs here: https://docs.python.org/3/library/contextlib.html | |
| >>> from contextlib import contextmanager | |
| >>> | |
| >>> | |
| >>> @contextmanager | |
| ... def deco_and_cm(): | |
| ... print('Hello') | |
| ... yield | |
| ... print('Goodbye') | |
| ... |
| import django | |
| DEBUG, ROOT_URLCONF, DATABASES, SECRET_KEY = 1, 'pico', {'default': {}}, 'p' | |
| urlpatterns = [django.conf.urls.url(r'^(?P<name>\w+)?$', lambda request, | |
| name: django.http.HttpResponse('hello %s!' % (name or 'world')))] |
Locate the path to the interpreter for the language you are writing in with the which command.
which node
which python
which bash
which ruby
Add that path as an interpreter directive (using #!) on the first line of your script. For example if you want to write a node script and which node returned /usr/local/bin/node, the first line of your script should be:
| #!/bin/bash | |
| # | |
| find . -type f -name '*.py[co]' -delete | |
| find . -type d -name '__pycache__' -delete |
| To change a field name in django 1.7+ | |
| 1. Edit the field name in the model (but remember the old field name: you need it for step 3!) | |
| 2. Create an empty migration | |
| $ python manage.py makemigrations --empty myApp | |
| 3. Edit the empty migration (it's in the migrations folder in your app folder, and will be the most recent migration) by adding | |
| migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'), | |
| to the operations list. |