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
<div class="container"> | |
{% for project in projects %} | |
{% if forloop.counter0|divisibleby:3 %} <div class="row text-center"> {% endif %} | |
<div class="col-md-4" onclick="window.location.href='{% url 'club:robotics_detail' project.id %}'" style="cursor: pointer"> | |
<div class="card"> | |
<img src="http://placehold.it/300X150" alt=""> | |
<div class="card-content"> | |
<br> | |
<h4>Project {{ forloop.counter }}</h4> | |
<hr> |
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
<style> | |
/* card css */ | |
.card{ | |
background-color: red; | |
margin: 0; | |
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2); | |
transition: 0.3s; | |
border-radius: 5px; /* 5px rounded corners */ | |
} |
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
upstream example { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
server unix:/webapps/example.com/gunicorn.sock fail_timeout=0; | |
} | |
server{ | |
listen 80; |
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
[program:example] | |
command=/webapps/example.com/gunicorn_start.sh | |
user=webapps | |
stdout_logfile=/webapps/example.com/logs/gunicorn_supervisor.log | |
redirect_stderr=true | |
environment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 |
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
#!/bin/bash | |
# Purpose: Gunicorn starter | |
# Author: [email protected] | |
# Name of an application | |
NAME="Your projectname" | |
# project directory | |
PROJECTDIR=/webapps/example.com | |
# django project virutalenv directory | |
VENVDIR=/webapps/example.com/venv | |
# Project source directory |
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
1. Enable the media context processor, from settings.py file | |
django.template.context_processors.media | |
2. Set MEDIA_URL and MEDIA_ROOT in settings.py file | |
MEDIA_URL = '/media' | |
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') | |
3. Serve the media from development server in url.py file | |
# Serving media files during development |
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
#!/bin/bash | |
# save this script to .git/hooks/pre-push | |
# Change the permission as chmod +x .git/hooks/pre-push | |
protected_branch='master' | |
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
if [ $protected_branch = $current_branch ] | |
then | |
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty |
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
// Defining new function in Es6 | |
// App is the | |
const App = () => { | |
return "Hello world"; | |
} | |
// new keyword | |
const = "Title" // Can only assigned once. | |
// Exporting the module |
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
.fa-icon{ | |
background-color: #2D3033; | |
color: silver; | |
padding: 10px; | |
border-radius: 50%; | |
text-align: center; | |
vert-align: middle; | |
width: 30px; | |
height: 30px; |