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
from django.contrib import admin | |
from models import * | |
admin.site.register(Person) |
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
function normalizeAccents(s){ | |
// cache para ganho de performance | |
if ( !! normalizeAccents.cache[s] ) return normalizeAccents.cache[s]; | |
var r=s.toLowerCase(); | |
//r = r.replace(new RegExp("\\s", 'g'),""); | |
r = r.replace(new RegExp("[àáâãäå]", 'g'),"a"); | |
r = r.replace(new RegExp("æ", 'g'),"ae"); | |
r = r.replace(new RegExp("ç", 'g'),"c"); | |
r = r.replace(new RegExp("[èéêë]", 'g'),"e"); |
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
// retorna um range de numeros, ex: range(0, 3) -> [0,1,2,3] | |
function rangeNumbers(a, b){ | |
var arr = []; | |
while(a<=b){ | |
arr.push(a); | |
a++; | |
} | |
return arr; | |
} |
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
<div id="texto_artigo_wrapper"> | |
<div id="texto_artigo"> | |
<h2 class="titulo_artigo">{{ pagina_atual.titulo }}</h2> | |
{% if pagina_atual.imagem_principal %} | |
<div class="box_foto {% if not pagina_atual.alinhamento_imagem %}left{% else %}{{ pagina_atual.alinhamento_imagem }}{% endif %}"> | |
{% if pagina_atual.autor_imagem %}<span class="credito"><span>Foto por:</span> {{ pagina_atual.autor_imagem }}</span>{% endif %} | |
<a href="#"><img src="{% thumbnail pagina_atual.imagem_principal 334x251 crop,upscale %}" alt="" /></a> |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
@-webkit-keyframes gradientAnimation{ | |
0% { opacity: 0; } | |
100% { opacity: 1; } | |
} | |
body{ |
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
<link rel="stylesheet" href="src/jquery.selectskin.css" type="text/css" media="screen"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script> | |
<script type="text/javascript" src="src/jquery.selectskin.js"></script> |
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
$(function(){ | |
$('select').SelectSkin(); | |
}); |
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
var Workspace = Backbone.Router.extend({ | |
routes: { | |
"help": "help", // #help | |
"search/:query": "search", // #search/kiwis | |
"search/:query/p:page": "search" // #search/kiwis/p7 | |
}, | |
help: function() { | |
... |
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
// Example of how to cache the result of an external jQuery Template. | |
// Inspired by this post... | |
// http://encosia.com/2010/10/05/using-external-templates-with-jquery-templates/ | |
var person = {name: 'Dave'}; | |
var person_tmpl; | |
$.get('_template.tpl.html', function(template) { | |
// Use converted string from remote file. |
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
import os | |
from django import template | |
from django.utils import version | |
from settings import PROJECT_PATH | |
STATIC_PATH = os.path.join(PROJECT_PATH, '../static') | |
register = template.Library() | |
@register.simple_tag | |
def revision_number(): |
OlderNewer