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
# | |
# Wide-open CORS config for nginx | |
# From: https://enable-cors.org/server_nginx.html | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; | |
# | |
# Custom headers and headers various browsers *should* be OK with but aren't |
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
#!/bin/bash | |
# Usage: ./djangoproject.sh PROJECT_NAME APP_NAME1 APP_NAME2 APP_NAME3 | |
# This script is written to handle up to three(3) applications. It can definitely be extended further... | |
SITE=$1 | |
firstapp=$2 | |
secondapp=$3 | |
thirdapp=$4 |
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
#!/bin/bash | |
# Get name of the site directory | |
# Create index.html | |
# Create css, js, and img sub-directories | |
# Create css and js files inside the respective folders | |
# Usage: ./startsite.sh SITE_PROJECT_NAME | |
# Tradução [Português] | |
# SITE vai armazenar o nome do argumento passado por meio do terminal. Esse nome será o nome do directório. | |
# Depois de criar o directório, entrasse no mesmo para a criação das pastas necessárias: CSS, JS, and IMG... |
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
""" | |
EventBrite.py | |
By Leo N. | |
An implementation of the EventBrite API. | |
Requirements: Python 3+, Internet, EventBrite API Key. | |
-------------------- | |
Structure of the JSON for an event object: |
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
#!/bin/bash | |
# Requirements: Python, Bottle | |
# A script that automates the creation of a bottle app. | |
SITE=$1 | |
print_usage(){ | |
echo "usage: newbottle [appname]" | |
echo " newbottle -h" | |
echo " newbottle -st" |
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
#!/bin/bash | |
# Requirements: Python3.6, Django and Git | |
# A handy script for creating Django Projects and their respective applications | |
# Usage: ./djangoproject.sh PROJECT_NAME APP_NAME1 APP_NAME2 APP_NAME3 APP_NAME4 | |
SITE=$1 | |
firstapp=$2 | |
secondapp=$3 | |
thirdapp=$4 | |
fourthapp=$5 |
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
#!/bin/bash | |
# Requirements: No special requirements. | |
# Usage: ./newsite.sh NAME_OF_SITE | |
SITE=$1 | |
HELP="-h" | |
print_usage(){ | |
echo "usage: newsite [nameofsite]" | |
echo " newsite -h" |
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
int A = 12; | |
// B is a pointer to the address of A | |
int *B = &A; | |
// C is a nickname for A, or a reference to A | |
// If either A or C change, both will change. | |
int &C = A; | |
C=99; |
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
# message.html | |
<form class="form" action="{% url 'validate' %}" id="" method="POST"> | |
{% comment %} csrf_token must be added for security reasons {% endcomment %} | |
{% csrf_token %} | |
<div class="form-group"> | |
<label for="emailLabel">Email address</label> | |
<input name="email" type="email" class="form-control" | |
id="email" aria-describedby="emailLabel" placeholder="Email Address"> | |
</div> |
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
cardArray = [0] * 52 | |
names = ["Oliver", "James", "Rui", "Ricky", "Paul"] | |
def setCardArrayToZero(): | |
print("Array before:") | |
print(cardArray) | |
for index in range(5): | |
cardArray[index] = 0 |
OlderNewer