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 / routes.py
Created May 7, 2014 11:21
Parameters for render_template in Flask
from flask import Flask
app = Flask(__name__)
@app.route("/"):
data = []
data["title"] = "My Page"
data["description"] = "Just a Page"
return render_template("index.html", **data)

Keybase proof

I hereby claim:

  • I am infog on github.
  • I am infog (https://keybase.io/infog) on keybase.
  • I have a public key whose fingerprint is A21D 5075 8E9C CCE9 D3B4 D767 B031 7CCF B522 0331

To claim this, I am signing this object:

@InFog
InFog / couchbase.sh
Last active August 29, 2015 13:56
Some Couchbase CLI
# Detele
couchbase-cli bucket-delete -c 127.0.0.1 -u Administrator -p mypassword --bucket=mybucket-to-delete
# Create
couchbase-cli bucket-create -c 127.0.0.1 -u Administrator -p mypassword --bucket=default --bucket-ram=300
# Restore
cbrestore default http://127.0.0.1:8091 -B default
@InFog
InFog / Debian R Packages
Created January 16, 2014 00:54
Debian packages for O'Reilly's "Machine Learning for Hackers"
Available packages (APT):
r-base
r-cran-ggplot2
r-cran-lme4
r-cran-reshape
r-cran-xml
CRAN only:
@InFog
InFog / ntp.sh
Created November 8, 2013 14:31
Setting DateTime using NTP
ntpdate 0.br.pool.ntp.org
@InFog
InFog / tarefas.css
Created October 7, 2013 00:37
CSS usado nos exemplos do sistema de tarefas do livro PHP e MySQL da Casa do Código http://www.casadocodigo.com.br/products/livro-php-mysql
body {
font-family: Sans-serif;
color: #333;
}
h1 {
text-align: center;
}
.erro {
@InFog
InFog / infog-bubblegum.zsh-theme
Last active December 20, 2015 19:38
Mais um tema ZSH - Baseado no Buublegum
# 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
PR_GIT_UPDATE=1
@InFog
InFog / procedural.php
Created July 20, 2013 22:35
Exemplo para o blog, PHP Procedural
<?php
$idade = trim($_POST['idade']);
$erro = false;
if (empty($idade)) {
$erro = 'Idade não pode ser vazia';
} elseif (! is_numeric($idade)) {
$erro = 'Idade deve ser numérica';
} elseif ($idade < 18) {

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

@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);