This guide assumes a fresh install of Mac OSX 10.8 Mountain Lion.
- Install XCode
# add first to your virtualenv (postactivate or autoenv, etc) | |
export GEM_HOME="$VIRTUAL_ENV/gems" | |
export GEM_PATH="" | |
export PATH=$PATH:"$GEM_HOME/bin" |
""" | |
Current Page Middleware. | |
This module provides a middleware that implements a mechanism to | |
highlight a link pointing to the current URL. | |
Thanks @davidbgk and @samueladam for improvements & optimizations | |
""" | |
import re |
jq('div').live('pagebeforeshow', function(event, ui){ | |
var page = jq(event.target); | |
var url = page.attr('data-refresh'); | |
if(url){ | |
var ajax = {}; | |
ajax.url = url; | |
ajax.type = 'GET'; |
// Handel max char left control for input and textarea | |
/* Set on your project this minumum css style (adapt for your need) | |
* mandatory for directive *maxlength-control* | |
*/ | |
/* | |
.maxlength-control ~ .maxlength-control-status { | |
color: #b5b5b5; | |
float: right; |
import Vue from 'vue' | |
import VeeValidate from 'vee-validate' | |
... | |
import RedactorEditor from './components/RedactorEditor.vue' | |
Vue.use(VeeValidate) |
class ContactForm(forms.Form): | |
name = forms.CharField(max_length=60) | |
message = forms.CharField(max_length=200, widget=forms.TextInput) | |
class SubscriptionForm(forms.Form): | |
email = forms.EmailField() | |
want_spam = forms.BooleanField(required=False) | |
from functools import partial | |
def placeholderify(form=None, fields=None): | |
""" | |
A decorator for Django forms that sets a `placeholder` attribute to all | |
fields. Each field's label is used as a placeholder. | |
Use it like so: | |
import React from "react"; | |
function WidthAndHeight() { | |
const [width, setWidth] = React.useState(window.innerWidth); | |
const [height, setHeight] = React.useState(window.innerHeight); | |
React.useEffect(() => { | |
window.addEventListener("resize", updateWidthAndHeight); | |
return () => window.removeEventListener("resize", updateWidthAndHeight); | |
}); |