Follow the steps below to setup a local development environment:
Recommended to download latest XQuartz
Follow the steps below to setup a local development environment:
Recommended to download latest XQuartz
atom-beautify | |
atom-color-highlight | |
autoclose-html | |
autocomplete-plus | |
git-blame | |
git-plus | |
jsdoc | |
jsformat | |
language-docker | |
language-dockerfile |
In python, you have floats and decimals that can be rounded. If you care about the accuracy of rounding, use decimal type. If you use floats, you will have issues with accuracy.
All the examples use demical types, except for the original value, which is automatically casted as a float.
To set the context of what we are working with, let's start with an original value.
function updateElementIndex(el, prefix, ndx) { | |
var id_regex = new RegExp('(' + prefix + '-\\d+)'); | |
var replacement = prefix + '-' + ndx; | |
if ($(el).attr("for")) $(el).attr("for", $(el).attr("for").replace(id_regex, replacement)); | |
if (el.id) el.id = el.id.replace(id_regex, replacement); | |
if (el.name) el.name = el.name.replace(id_regex, replacement); | |
} | |
function addForm(btn, prefix) { | |
var formCount = parseInt($('#id_' + prefix + '-TOTAL_FORMS').val()); |
Create this file in your graphite installation directory: lib/python2.7/site-packages/graphite/crossmiddleware.py
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
# | |
# Acts as a nginx HTTPS proxy server | |
# enabling CORS only to domains matched by regex | |
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/ | |
# | |
# Based on: | |
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html | |
# * http://enable-cors.org/server_nginx.html | |
# | |
server { |
server { listen 80; | |
server_name example.com; | |
access_log /var/log/example.com/nginx.access.log; | |
error_log /var/log/example.com/nginx.error.log; | |
root /var/www/apps/example.com/public; | |
charset utf-8; | |
location / { | |
rewrite ^ https://$host$request_uri? permanent; | |
} |
# coding=utf-8 | |
import hashlib | |
from django import forms | |
from .khipu_settings import USER_ID, USER_KEY | |
class KhipuPaymentForm(forms.Form): |
def get_form_list(request): | |
form_list = [ | |
("categories", forms.CategoriesForm), | |
("description", forms.CategoriesForm)] | |
templates = { | |
"categories": "categories.html", | |
"description": "description.html"} | |
if not request.user.is_authenticated(): | |
form_list.append(("register", forms.CategoriesForm)) | |
templates["register"] = "step-register.html" |
# Recursively find and replace in files | |
find . -type f -name '*.js' ! -path "./node_modules/*" -exec sed -i '' s/'old_string'/'new_string'/ {} + |