This file contains hidden or 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
#!/bin/bash | |
# Os usuários precisam estar no grupo chamado git! (Configurar em /etc/group) | |
# Modo de usar: | |
# ./git-server.sh nome-do-projeto | |
mkdir $1 | |
cd $1 | |
git init --shared=group | |
git config --bool core.bare true |
This file contains hidden or 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
# -*- encoding: utf-8 -*- | |
class Robo: | |
def perguntar_filme(self): | |
self.filme = raw_input("Qual seu filme favorito? \n") | |
def comentar_sobre_o_filme(self): | |
print 'Caramba, esse filme ' + str(self.filme) + ' também é meu favorito!' | |
def perguntar_sobre_comida(self): |
This file contains hidden or 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 http_request = false; | |
if (window.XMLHttpRequest) { // Mozilla, Safari,... | |
http_request = new XMLHttpRequest(); | |
if (http_request.overrideMimeType) { | |
http_request.overrideMimeType('text/xml'); | |
} | |
} else if (window.ActiveXObject) { // IE | |
try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); | |
} catch (e) { | |
try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); |
This file contains hidden or 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>sem título</title> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8" /> | |
<meta name="generator" content="Geany 0.19.1" /> | |
<style> |
This file contains hidden or 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 mountCounter(p_seconds) | |
{ | |
var hours = new String(parseInt(parseInt(p_seconds) / 3600)); | |
var minutes = new String(parseInt((p_seconds / 60) % 60)); | |
var seconds = new String(parseInt(p_seconds % 60)); | |
if(hours.length == 1) hours = '0' + hours; | |
if(minutes.length == 1) minutes = '0' + minutes; | |
if(seconds.length == 1) seconds = '0' + seconds; |
This file contains hidden or 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 getCEP($psCEP) | |
{ | |
echo utf8_encode(urldecode(trim(@file_get_contents('http://cep.republicavirtual.com.br/web_cep.php?cep='.urlencode($psCEP).'&formato=javascript')))); | |
// Retorna var resultadoCEP = { 'uf' : 'UF', 'cidade' : 'Cidade', 'bairro' : 'Bairro', 'tipo_logradouro' : 'Avenida', 'logradouro' : 'Logradouro', 'resultado' : '1', 'resultado_txt' : 'sucesso - cep completo' } | |
} | |
?> |
This file contains hidden or 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
<?php | |
$i = 0; | |
while ($i++ < 5 && !$connected) | |
{ | |
$connected = ($this->_resource = mysql_connect($host, $user, $password, true)); | |
if(!$connected) { | |
sleep(1); | |
} |
This file contains hidden or 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
<?php | |
interface IStrategy | |
{ | |
public function mover(); | |
public function falar(); | |
} | |
class Strategy implements IStrategy { | |
private $objeto; |
This file contains hidden or 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
$('.js-tweet-text').each(function() { if($(this).text().match(/^@/g)) $(this).closest('.tweet').remove(); }); |
This file contains hidden or 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 g_link_amigos = ['http://chav.in/1wh', 'http://chav.in/1CO']; | |
jQuery(function() { | |
jQuery(".link-amigos").attr('href', g_link_amigos[(Math.floor(Math.random()*g_link_amigos.length))]); | |
}); |
OlderNewer