Em JavaScript há uma comportamento chamado hoisting
.
O uso de var
trazia algumas pegadinhas, como por exemplo, declarar a mesma variável 2x usando var
var abc = 25
// ...
// ...
var abc = 99
# coding=utf-8 | |
""" | |
**Implementa um Webcrawler para extracao de dados da pesquisa de media de precos realizada periodicamente pela ANP** | |
Desenvolvido por Fabio C. Barrionuevo da Luz. - 2013 | |
Simple crawler to ANP site | |
Copyright (C) 2013 Fabio C. Barrionuevo da Luz. | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
as published by the Free Software Foundation; either version 2 |
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/). | |
var colorbrewer = {YlGn: { | |
3: ["#f7fcb9","#addd8e","#31a354"], | |
4: ["#ffffcc","#c2e699","#78c679","#238443"], | |
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"], | |
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"], | |
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"], | |
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"], | |
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"] | |
},YlGnBu: { |
#!/bin/bash | |
############################################################################## | |
# Install system packages # | |
############################################################################## | |
# if apt-get exists, probably it's a Linux | |
if which apt-get > /dev/null; then | |
# update & clean up |
from django.forms import ModelForm | |
from django.forms.models import inlineformset_factory | |
from models import Sponsor, Sponsorship | |
class SponsorForm(ModelForm): | |
class Meta: | |
model = Sponsor |
from collections import defaultdict | |
import copy | |
import csv | |
import json | |
from urllib.parse import urlparse | |
def parser_urls(urls, orig={}): | |
''' | |
recebe uma lista de urls e vai parseando enquanto essa tiver um diretorio |
#!/usr/bin/env bash | |
# Install dependencies | |
yum update -y | |
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel | |
mkdir setup && cd setup | |
wget wget https://olex-secure.openlogic.com/content/private/5e6a6f0815e830bba705e79e4a0470fbee8a5880//olex-secure.openlogic.com/httpd-2.4.16.tar.gz | |
tar -xvf httpd-2.4.16.tar.gz |
#!/usr/bin/env python | |
# post-receive hook for git-based deployments | |
# https://edmondburnett.com/post/python-push-to-deploy | |
import sys | |
import os | |
from subprocess import call | |
# configuration | |
deploy_to_path = '/path/to/deploy/directory/' |
#models.py | |
class Task(models.Model): | |
title = models.CharField(max_length=255) | |
description = models.TextField() | |
def __unicode__(self): | |
return self.title | |
Em JavaScript há uma comportamento chamado hoisting
.
O uso de var
trazia algumas pegadinhas, como por exemplo, declarar a mesma variável 2x usando var
var abc = 25
// ...
// ...
var abc = 99
function filter(element, selector) { | |
var value = $(element).val().toUpperCase(); | |
$(selector +" li").each(function () { | |
if ($(this).text().toUpperCase().indexOf(value)> -1) { | |
$(this).show(); | |
} else { | |
$(this).hide(); | |
} | |
}); | |
} |