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
/* | |
nomeMenu = "Menu que sera selecionado", | |
item = "Item do menu que sera selecionado", | |
conteudo = "conteudo do menu que sera selecionado" | |
Teste URL: http://jsbin.com/ecitid/4 | |
*/ | |
function alternarAbas(nomeMenu,item,conteudo){ | |
var mElement = $(nomeMenu+" "+item); | |
$(conteudo).css({display:"none"}); | |
$(conteudo+":eq(0)").css({display:"block"}); |
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
/*Alternar opções*/ | |
function alternarOpt(menu, itens){ | |
/*Esconde os itens*/ | |
$(itens).css({visibility:"hidden"}); | |
$(menu).bind('click', function(){ | |
var item = $(menu).index(this); | |
var vItem = $(menu+':eq('+item+')').attr("value"); |
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
$(menuItem+' a').attr({target:'_top'}); | |
var urlAct = $(menuItem+classAct+' a').attr('href'); | |
$(frame).load(urlAct); | |
$(menuItem).bind('click',function(){ | |
var url = $(this).find('a').attr('href'); | |
var indice = $(menuItem+' a').index(this); | |
$(this).find('a').attr({href:" "}); | |
$(frame).load(url,function(){ | |
$(menuItem+' a:eq('+indice+')').attr({href:'#'+url}); |
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
#!/usr/bin/python | |
#pega a entrada do usuario | |
n = raw_input('Digite o valor: ') | |
def fatorar(v): | |
if v: | |
try: | |
v = int(v) | |
except ValueError: | |
v = 0 |
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
Original Source: https://github.com/chneukirchen/styleguide | |
= Christian Neukirchen's Ruby Style Guide | |
You may not like all rules presented here, but they work very well for | |
me and have helped producing high quality code. Everyone is free to | |
code however they want, write and follow their own style guides, but | |
when you contribute to my code, please follow these rules: | |
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
syntax on " Syntax color | |
set number " Numeration line by line | |
colorscheme torte " Set a desert scheme to default | |
" Search color | |
hi Search cterm=none ctermbg=4 ctermfg=15 | |
set hlsearch | |
" History | |
set history=700 | |
" Autoread | |
set autoread |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
#! /usr/bin/env python | |
# -*- coding: utf8 -*- | |
class Naturals(object): | |
def __init__(self, n): | |
self.n = n | |
def sum_square(self): | |
for i in range(self.n): | |
i = i**2 |
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
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
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 Event = function Event() { | |
var _target; | |
this.setTarget = function setTarget( value ) { | |
value = value || ''; | |
if ( value ) { | |
_target = value; | |
} | |
} |
OlderNewer