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 contact(request): | |
if request.method == 'POST': # If the form has been submitted... | |
form = ContactForm(request.POST) # A form bound to the POST data | |
if form.is_valid(): # All validation rules pass | |
# Process the data in form.cleaned_data | |
# ... | |
return HttpResponseRedirect('/thanks/') # Redirect after POST | |
else: | |
form = ContactForm() # An unbound form |
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
/******* BASE *******/ | |
/* Section for normalize, layout, typography styles */ | |
/******* END BASE *******/ | |
/******* COMPONENTS *******/ | |
/* Section for alerts, buttons, forms, list, nav, tables styles */ | |
/******* END COMPONENTS *******/ | |
/******* MODULES *******/ | |
/* Section for aside, footer, header styles */ | |
/******* END MODULES *******/ |
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
{% capture words %} | |
{{ post.content | number_of_words | divided_by:180 }} | |
{% endcapture %} | |
{% assign word_count = words | times: 1 %} | |
{% if word_count != 0 %} | |
<span>{{ word_count }} minute read</span> | |
{% else %} | |
<span>less than {{ word_count | plus: 1 }} minute read</span> | |
{% endif %} |
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
# Outputs the reading time | |
# Read this in “about 4 minutes” | |
# Put into your _plugins dir in your Jekyll site | |
# Usage: Read this in about {{ page.content | reading_time }} | |
module ReadingTimeFilter | |
def reading_time( input ) | |
words_per_minute = 180 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Bootstrap --> | |
<link href="css/bootstrap.min.css" rel="stylesheet"> | |
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> | |
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
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
class PythonClass: | |
def __init__(self): | |
"""Constructor""" | |
def method(self): | |
return "Hello World!" | |
anInstance = PythonClass() |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Bootstrap 101 Template</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<!-- Bootstrap --> | |
<link href="css/bootstrap.min.css" rel="stylesheet"> | |
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> | |
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> |
NewerOlder