Skip to content

Instantly share code, notes, and snippets.


Collin Rukundo crukundo

View GitHub Profile
badri / cbv_multiple_forms.html
Created Jan 18, 2018
Django multiple forms code with sample usage
View cbv_multiple_forms.html
{% extends "base.html" %}
{% block content %}
<form method="post">{% csrf_token %}
{{ forms.subscription }}
<input type="submit" value="Subscribe">
<form method="post">{% csrf_token %}
{{ }}
<input type="submit" value="Send">
bl4ck5un / responsive-semantic-ui.css
Created May 12, 2017
Responsive helpers (mobile-only etc.) for semantic-ui
View responsive-semantic-ui.css
/* Semantic UI has these classes, however they're only applicable to*/
/* grids, containers, rows and columns.*/
/* plus, there isn't any `mobile hidden`, `X hidden` class.*/
/* this snippet is using the same class names and same approach*/
/* plus a bit more but to all elements.*/
/* see*/
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
pitch-gist / gist:2999707
Created Jun 26, 2012
HTML: Simple Maintenance Page
View gist:2999707
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
pylemon /
Created Apr 7, 2012
django: using(request.POST or None) hack in views | advanced forms usage
# simple form usage in view
def my_view(request, template_name='home.html'):
# sticks in a POST or renders an empty form
form = MyForm(request.POST or None)
if form.is_valid():
return redirect('/')
return render_to_response(template_name, {'form':form})
# form with files