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 / gist:2791158
Created May 25, 2012 23:23
Exemplo Ajax com Twitter
<html>
<head>
</head>
<body>
<h1>Tweets mencionando a Unimonte</h1>
<ul id="lista_tweets">
</ul>
</body>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
@InFog
InFog / gist:2818715
Created May 28, 2012 11:39
Envio de e-mails para a lista de inscritos no Ação Mozilla nas Universidades Unaerp
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from time import sleep
@InFog
InFog / gist:2818721
Created May 28, 2012 11:41
Sorte do dia usando o Fortunes
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import system
print("Olá, bem vindo ao Sorte do Dia!")
nome = ""
while nome == "":
@InFog
InFog / server.wsgi
Created June 4, 2012 20:47
WSGI com Bottle e VirtualEnv
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import site
current_path = os.path.abspath(os.path.dirname(__file__))
# check for python's version
@InFog
InFog / wsgi.py
Created June 12, 2012 19:26
WSGI com Flask e VirtualEnv
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import site
current_path = os.path.abspath(os.path.dirname(__file__))
# sempre verifique a versão do Python no sistema
@InFog
InFog / formgenlib.php
Created October 27, 2012 13:48
Modelo formgenlib
<?php
class Meucontroller extends Controller {
/**
* _form
*
* Formulário para adição/edição de qualquer dado.
*
* @param Qualquer_dado $qualquer_dado
@InFog
InFog / infog.zsh-theme
Last active October 12, 2015 23:47
Meu tema ZSH
# prompt style and colors based on Steve Losh's Prose theme:
# http://github.com/sjl/oh-my-zsh/blob/master/themes/prose.zsh-theme
#
# vcs_info modifications from Bart Trojanowski's zsh prompt:
# http://www.jukie.net/bart/blog/pimping-out-zsh-prompt
#
# git untracked files modification from Brian Carper:
# http://briancarper.net/blog/570/git-info-in-your-zsh-prompt
function virtualenv_info {
@InFog
InFog / .zshrc
Last active October 12, 2015 23:47
Configuração ZSH
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="infog"
# Temas legais: bira, muse, steef
@InFog
InFog / .bashrc
Created March 14, 2013 12:50
My ROOT .bashrc (work in progress)
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
PS1='\n${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;35m\]\w\[\033[00m\]\n\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
# eval "`dircolors`"
@InFog
InFog / oo.js
Created April 25, 2013 11:12
Exemplo de OO em JS usando uma função. Existe uma associação de evento para definir o nome de p1.
var MyClass = function () {
this.name = "";
this.setName = function (name) {
this.name = name; // Este this é o MyClass, não a function atual
};
this.getName = function () {
return this.name;
};
this.keyPressSetter = function (k) {
this.name = this.name + String.fromCharCode(k.keyCode);