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
| # Advanced example starting 10 workers in the background: | |
| # * Three of the workers processes the images and video queue | |
| # * Two of the workers processes the data queue with loglevel DEBUG | |
| # * the rest processes the default' queue. | |
| $ celery multi start 10 -l INFO -Q:1-3 images,video -Q:4,5 data -Q default -L:4,5 DEBUG | |
| $ CELERYD_OPTS="--time-limit=300 --concurrency=8 -l INFO -Q:1-3 images,video -Q:4,5 data -Q default -L:4,5 DEBUG" |
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
| pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U |
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
| for i in 5196 6020; do scrapy crawl spider_name -a id=$i -a do_action=yes; done | |
| # or | |
| for i in {100..200}; do scrapy crawl spider_name -a id=$i -a do_action=yes; done |
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
| <?php | |
| /** | |
| * Include posts meta in admin search | |
| */ | |
| add_filter( 'posts_distinct', 'cf_search_distinct' ); | |
| add_filter('posts_join', 'cf_search_join' ); | |
| add_filter( 'posts_where', 'cf_search_where' ); | |
| function cf_search_join( $join ) { | |
| global $wpdb; |
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
| #!/bin/sh | |
| sudo apt update | |
| sudo apt -y install \ | |
| autoconf \ | |
| automake \ | |
| build-essential \ | |
| cmake \ | |
| git \ | |
| libass-dev \ |
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
| #!/bin/sh | |
| curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
| tar xzvf yasm-1.3.0.tar.gz | |
| cd yasm-1.3.0 | |
| ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" | |
| make | |
| make install | |
| git clone --depth 1 http://git.videolan.org/git/x264 | |
| cd x264 |
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
| {% if is_paginated %} | |
| <div class="pagination"> | |
| <ul> | |
| {% if page_obj.has_previous %} | |
| <li><a href="?page={{ page_obj.previous_page_number }}"> | |
| {% else %} | |
| <li class="disabled"><a href="#"> | |
| {% endif %} | |
| Prev</a></li> | |
| {% for p in page_obj.paginator.page_range %} |
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
| def reservation_f(request, year, month, day): | |
| ReservationFormset = modelformset_factory( | |
| Reservation, | |
| extra = 1, | |
| fields = ('order_count', 'order_name', 'order_date'), | |
| form = Reserve, | |
| ) | |
| if request.method == "POST": | |
| formset = ReservationFormset(request.POST, queryset=Food.objects.none(), | |
| form_kwargs={'month': month, 'year': year, 'day':day}) |