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
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
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
git switch yourBranch | |
git reset --soft $(git merge-base main HEAD) | |
git commit -m "one commit on yourBranch" |
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 abc | |
from collections import Counter | |
from pathlib import Path | |
from typing import Protocol, Iterable | |
from exif import Image | |
class BaseImageCollector(Protocol): | |
@property |
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
from django.conf import settings | |
from django.core.management import BaseCommand | |
from django.urls import URLPattern, URLResolver | |
urlconf = __import__(settings.ROOT_URLCONF, {}, {}, ['']) | |
def list_urls(lis, acc=None): | |
if acc is None: | |
acc = [] | |
if not lis: |
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/bash | |
# ============================================================= | |
# UPDATE SOURCE | |
# ============================================================= | |
# git clone https://github.com/tensorflow/tensorflow | |
# git checkout -- . | |
# git pull origin master | |
# TF_BRANCH=r1.8 | |
TF_ROOT=/home/tensorflow |
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
""" Generates and decodes an unique invoice id, which can use characters | |
to shorten its length. | |
Author: Will Hardy | |
Date: December 2008 | |
Usage: >>> encode(1) | |
"488KR" | |
Description: Invoice numbers like "0000004" are unprofessional in that they | |
expose how many sales a system has made, and can be used to monitor |
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
{"lastUpload":"2020-02-25T19:34:31.814Z","extensionVersion":"v3.4.3"} |
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
$ diskutil list | |
$ diskutil eraseDisk MS-DOS "WIN10" MBR diskX | |
$ cp -rp /Volumes/WIN10_X64_PRO_VL/* /Volumes/WIN10 |
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
$ brew install mysql-connector-c | |
$ vim /usr/local/bin/mysql_config | |
Change | |
# on macOS, on or about line 112: | |
# Create options | |
libs="-L$pkglibdir" | |
libs="$libs -l " | |
to | |
# Create options |
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
// Extra small screen / phone | |
@screen-xs: 480px; | |
@screen-xs-min: @screen-xs; | |
// Small screen / tablet | |
@screen-sm: 768px; | |
@screen-sm-min: @screen-sm; | |
// Medium screen / desktop | |
@screen-md: 992px; |
NewerOlder