--type=text
to the command. If you know you'll always want to search text files, you can create a
.ackrc
file in your home directory with the same command in it:
--type=text
Ack just adds anything from this file to the command.
Programming and Unix Tips and Tricks
--type=text
.ackrc
file in your home directory with the same command in it:
--type=text
$ identify filename.png
$ identify button.png
button.png PNG 127x34 127x34+0+0 8-bit DirectClass 3.5KiB 0.000u 0:00.000
-verbose
to the command.
=# \pset pager
This will toggle pagination, so you can use it again to go back to the normal mode. (The "=#" is just the prompt; type the stuff following that)$ psql -U admin db_name --pset pager=off
alias psql='psql --pset pager=off'
Recently I was designing an email that gets sent to customers. In it I had an email address, but it wasn't meant to be used to send an actual email, just to copy and paste. Gmail automatically converted it to a mailto link, which made it clickable and thus harder to select the text. Here's what I did to force it back to text.
<p>Please add blah@yadda.com to your address book.</p>
<p>Please add <a href="mailto:blah@yadda.com" target="_blank">blah@yadda.com</a> to your address book.</p>
Please add blah@yadda.com to your address book.
<p>Please add blah<span>@</span>yadda<span>.</span>com to your address book.</p>
Please add blah@yadda.com to your address book.
Unfortunately, this will only work for HTML emails, not plaintext emails.
$.post('{% url affiliate.views.manage_access %}', { id_list: [1,2,3], });You can't just grab the value from the post like you normally would, since it will only grab one of the items. So this won't work:
def manage_access(request): id_list = request.POST['id_list']You must instead do this:
def manage_access(request): id_list = request.POST.getlist('id_list[]')
{{ variable_name }}Sometimes you want to print out "{{" or "}}" without django trying to interpret it. Here's an example of how to escape the the template tags:
{% templatetag openvariable %} blah {% templatetag closevariable %}
>>> s = 'try to match thisblahblahend and not that end or else...' >>> r = re.compile('this(?P.+?)end') >>> m = r.search(s) >>> m.group('my_match') 'blahblah'