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
[MASTER] | |
load-plugins = pylint.extensions.mccabe, pylint_django | |
ignore-patterns = manage.py, \d{4}.*.py | |
good-names = application, urlpatterns | |
[REPORTS] | |
output-format = colorized | |
[TYPECHECK] | |
generated-members = url, py* |
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
"""Command to do something.""" | |
import logging | |
from django.core.management.base import BaseCommand | |
logger = logging.getLogger(__name__) | |
class Command(BaseCommand): |
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
def main(): | |
print("Importing tell the time module") | |
import tell_the_time | |
print("Importing tell the time module again") | |
import tell_the_time as tell_the_time_again | |
if __name__ == '__main__': | |
main() |
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
/** | |
* Get memory usage information. | |
* | |
* Requires {@link https://gist.github.com/3759346 strtobytes}. | |
* | |
* @author Craig Anderson <craiga@craiga.id.au> | |
* @link https://gist.github.com/craiga/9e35e52168aefe58b9eb | |
*/ | |
function get_mem_info() | |
{ |
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
<?php | |
/** | |
* Generate a random string. | |
* | |
* Based on {@link https://gist.github.com/craiga/4075392 a JavaScript function}. | |
* | |
* @param $alphabet (optional) The alphabet used to generate a random string. | |
* @param $minLength (optional) The minimum length of the string. 10 by default. | |
* @param $maxLength (optional) The maximum length of the string. 20 by default. |
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
<?php | |
/** | |
* Functions for timing. Requires {@link https://gist.github.com/craiga/1849563 Logging} and {@link https://gist.github.com/craiga/3186287 formatTime}. | |
* | |
* @author Craig Anderson <craiga@craiga.id.au> | |
* @link https://gist.github.com/craiga/8409711 | |
*/ | |
trait Timable { |
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
<?php | |
require_once(realpath(dirname(__FILE__ )) . "/../logging-trait/Logging.php"); | |
/** | |
* Functions for locking. | |
* | |
* _lock, _unlock and _isLockedByOther for file-based, non-blocking locking. | |
* | |
* @author Craig Anderson <craiga@craiga.id.au> |
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
<?php | |
/** | |
* Get a unique random integer. | |
* | |
* @author Craig Anderson <craiga@craiga.id.au> | |
* @link https://gist.github.com/craiga/6085988 | |
*/ | |
function unique_rand($min = 0, $max = null) { | |
static $prev = array(); |
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
<?php | |
/** | |
* Flatten an array, preserving keys. | |
* | |
* @author Craig Anderson <craiga@craiga.id.au> | |
* @link https://gist.github.com/craiga/5855194 | |
*/ | |
function flattenArray($in) { | |
$out = array(); |