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 re | |
import logging | |
from django.conf import settings | |
from django.urls import LocaleRegexURLResolver | |
from django.utils.translation import get_language | |
logger = logging.getLogger("django") | |
class NoPrefixLocaleRegexURLResolver(LocaleRegexURLResolver): |
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
# how to calculate BMI | |
def BMI(height, weight): | |
bmi = weight/(height**2) | |
return bmi | |
# Driver code | |
height = 1.79832 | |
weight = 70 | |
# calling the BMI function |
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 $ from "jquery"; | |
/** | |
* Generate a jQuery plugin | |
* @param pluginName [string] Plugin name | |
* @param className [object] Class of the plugin | |
* @param shortHand [bool] Generate a shorthand as $.pluginName | |
* | |
* @example | |
* import plugin from 'plugin'; |
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 $ from "jquery"; | |
import plugin from "./plugin"; | |
class ScrollToTop { | |
constructor(element, options) { | |
const $element = $(element); | |
$(window).scroll(function () { | |
if ($(this).scrollTop() > options.offset) { | |
$element.fadeIn(); |
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
""" | |
Prints CSV of all fields of a model. | |
""" | |
import csv | |
import logging | |
import sys | |
from django.core.management.base import BaseCommand |
NewerOlder