A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
This file contains 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 | |
""" | |
# Version | |
2021-08-31 | |
# Tested on | |
Python 3.9 | |
This file contains 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
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
from optparse import make_option | |
from django.core.management.base import BaseCommand | |
from django.core.management.base import CommandError | |
from django.db import connections | |
from django.db import DEFAULT_DB_ALIAS | |
from django.db.backends import BaseDatabaseClient |
- 更新
2013-10-15
- バージョン
0.1.3
- 作者
@voluntas
- URL
This file contains 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
''' | |
PIL's Image.thumbnail() returns an image that fits inside of a given size (preserving aspect ratios) | |
but the size of the actual image will vary and is certainly not guaranteed to be the requested size. | |
This is often inconvenient since the size of the returned thumbnail cannot be predicted. The django-thumbs | |
library solves this for square thumbnails by cropping the image to a square and then resizing it. However, | |
this only works for exact squares. | |
This function generalizes that approach to work for thumbnails of any aspect ratio. The returned thumbnail | |
is always exactly the requested size, and edges (left/right or top/bottom) are cropped off to adjust to | |
make sure the thumbnail will be the right size without distorting the image. |
This file contains 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
Number::pad = (digits, signed) -> | |
s = Math.abs(@).toString() | |
s = "0" + s while s.length < digits | |
(if @ < 0 then "-" else (if signed then "+" else "")) + s | |
Date.months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] | |
Date.weekdays = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] | |
Date.formats = | |
"a": -> Date.weekdays[@getDay()].substring(0, 3) |