For Homebrew v2.6.x and below:
brew cask install ngrok
For Homebrew v2.7.x and above:
# From http://vanderwijk.info/blog/adding-css-classes-formfields-in-django-templates/#comment-1193609278 | |
from django import template | |
register = template.Library() | |
@register.filter(name='add_attributes') | |
def add_attributes(field, css): | |
attrs = {} | |
definition = css.split(',') |
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
from functools import wraps | |
from django.conf import settings | |
from django.http import HttpResponseRedirect | |
def require_ssl(view): | |
""" | |
Decorator that requires an SSL connection. If the current connection is not SSL, we redirect to the SSL version of | |
the page. |
This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.
I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.
Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.
jQuery(document).ready(function() { | |
//Set-up some constants. | |
var scrollTimeout; | |
var scrollUsePushStateInstead = false; //Set to true to make the history stack of the browser include every point when posts were loaded. It's kind of annoying. | |
var scrollDelay = 200; //Milliseconds | |
var scrollLoading = false; | |
var triggerOffset = $(document).height() - $('#pagination').siblings().eq(-4).offset().top; //The point of this is to do one calculation up front instead of multiple calculations every time the infinite scroll is triggered. | |
// Simple feature detection for History Management (borrowed from Modernizr) | |
function supportsHistory() { |
Allows you to easily validate, clean, check type of card based on number, and verify the security code. It's small, has the fastest luhn implementation, works for all major cards without complex expressions, framework agnostic, and doesn't cost your company a small fortune to use like other libraries.
Easily hook it up to any framework, any code, easy to port.
Type
from django.core.paginator import Paginator, InvalidPage, EmptyPage | |
def paginate(request, object_list, limit=10, page_range=10, object_pk=None): | |
paginator = Paginator(object_list, limit) | |
page = None | |
if object_pk: | |
if hasattr(object_list, 'values_list') and callable( | |
object_list.values_list): | |
object_list = list(object_list.values_list('pk', flat=True)) |
CSS OFF | |
Volume 3—September 2013 | |
Positioning Relatives | |
In 1958, English pictorial photographer Henry Peach Robinson created the world's first photomontage by combining five different negatives to make one complete print of a young girl on her deathbed. “Fading Away”—Robinson's first and most famous composite photo—depicts a young girl dying of consumption and was controversial when it was exhibited, with many believing it was not a suitable subject for photography. | |
Box Model | |
The Barbie doll was invented in 1959 by Ruth Handler (co-founder of Mattel), whose own daughter was called Barbara. Barbie was introduced to the world at the American Toy Fair in New York City. Barbie's job was teenage fashion doll. The full name of the first doll was Barbie Millicent Roberts, from Willows, Wisconsin. | |
Staying afloat |