Skip to content

Instantly share code, notes, and snippets.

View InFog's full-sized avatar
🤔
Thinking

Evaldo Bento InFog

🤔
Thinking
View GitHub Profile
@InFog
InFog / escopos.php
Created August 30, 2015 22:05
Escopos
<?php
$nome = 'InFog';
echo $nome; // InFog
function mostraNome()
{
$nome = 'Coragem';
echo $nome;
}
@InFog
InFog / escopos2.php
Created August 30, 2015 22:09
Mais escopos
<?php
$livro = 'O Senhor dos Aneis';
function mostraFilme()
{
$filme = 'O Hobbit';
echo $filme;
}
@InFog
InFog / php_horror.php
Created March 20, 2011 15:44
PHP HORROR!
<?php
/**
* PHP HORROR!
*/
$____ = 'value';
echo $____;
@InFog
InFog / oo.js
Created March 31, 2011 12:36
Um exemplo pequeno de OO em JavaScript
/**
* Objeto Usuario (Classe)
*/
Usuario = function(nome, email) {
this.nome = nome;
this.email = email;
};
// Métodos do objeto Usuario
Usuario.prototype.pegarNome = function() {
@InFog
InFog / bashrc.sh
Created May 3, 2011 13:40
Exibir os branches do Git e do Mercurial (hg) no prompt do Bash
# Adicione essas funções ao final do seu arquivo ~/.bashrc
# Branches do Git
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[GIT:\1\]/'
}
# Branches do Mercurial
parse_hg_branch() {
thisbranch=`hg branch 2> /dev/null`
@InFog
InFog / cassia.py
Created June 7, 2011 01:53
Para Cássia
#!/usr/bin/python
from commands import getoutput
from time import sleep
while True:
out = ''
for l in 'Te Amo Cassinha!':
out += l
if l == ' ':
@InFog
InFog / about.md
Created August 22, 2011 13:07 — forked from PotHix/about.md
Programming Achievements: How to Level Up as a Developer
@InFog
InFog / hgrc
Created August 25, 2011 23:46 — forked from bralpassos/Arquivo de configuração do Mercurial
Arquivo de configuração do Mercurial
[ui]
username = infog
editor = vim
verbose = True
[extensions]
# relevância dos desenvolvedores (em linhas)
churn =
@InFog
InFog / a.php
Created September 3, 2011 16:56
Associações que vão gerar MUITA CONFUSÃO na sua sessão da tarde
<?php
$a = 'b';
$t = array(
(isset($a)) ? 'Sim' : 'Não' => (isset($a)) ? 'Sim' : 'Não',
'a' => ($a == 'c') ? 'A = C' : 'A != C'
);
print_r($t);
@InFog
InFog / .bashrc
Created October 6, 2011 23:25
My .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# don't overwrite GNU Midnight Commander's setting of `ignorespace'.
export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups