Skip to content

Instantly share code, notes, and snippets.

View TiuTalk's full-sized avatar
🌴
Tropical Developer

Thiago Belem TiuTalk

🌴
Tropical Developer
  • Assando Sites
  • Arraial d'Ajuda, BA - Brazil
  • 21:39 (UTC -03:00)
View GitHub Profile
bower install
{
"name": "meu-projeto",
"version": "0.0.0",
"dependencies": {
"jquery": "master",
"angular": "1.0.7"
}
}
# Instala os pacotes definidos no bower.json do seu projeto
bower install
# Instala um pacote específico
bower install <package>
# Instala uma versão (git tag) de um pacote
bower install <package>#<version>
npm install -g bower
# admin/posts/_form.html.haml
= f.actions do
= f.action :submit, button_html: { onclick: 'this.form.target = "_self"; return true' }
= f.action :submit, label: 'Preview', button_html: { onclick: 'this.form.target = "_blank"; return true' }
<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $components = array('Session', 'Auth');
public function isPrefix($prefix) {
return isset($this->request->params['prefix']) && $this->request->params['prefix'] == $prefix;
}
@TiuTalk
TiuTalk / valida.php
Last active December 16, 2015 12:49
<?php
// Inclui nossa classe com os métodos de segurança
require_once "Seguranca.php";
// Dados vindos do formulário
$usuario = $_POST['usuario'];
$senha = $_POST['senha'];
// Autentica o usuário
if ($Seguranca->login($usuario, $senha)) {
<form method="post" action="valida.php">
<label for="usuario">Usuário</label>
<input type="text" name="usuario" id="usuario" />
<label for="senha">Senha</label>
<input type="password" name="senha" id="senha" />
<input type="submit" value="Entrar" />
</form>
CREATE TABLE IF NOT EXISTS `usuarios` (
`id` INT(10) unsigned NOT NULL AUTO_INCREMENT,
`nome` VARCHAR(100) NOT NULL,
`usuario` VARCHAR(50) NOT NULL,
`senha` CHAR(40) NOT NULL,
PRIMARY KEY (`id`)
);
@TiuTalk
TiuTalk / gist:5431326
Created April 21, 2013 22:28
Magento
$ ab -kc 20 -t 60 http://demo.magentocommerce.com/sony-vaio-11-1-notebook-pc.html/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking demo.magentocommerce.com (be patient)
Finished 433 requests