This file contains 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 | |
/** | |
* Class Pessoa | |
* Exemplo de como funciona o __set em intercepções em php | |
* autor: Frankyston Lins Nogueira | |
*/ | |
class Pessoa | |
{ | |
private $nome; | |
private $idade; |
This file contains 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 | |
# Primeiro exemplo de echo | |
echo "Olá"; | |
# Segundo exemplo de echo | |
echo 'Olá'; | |
# Terceiro exemplo de echo | |
$var = "olá"; |
This file contains 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
<% article.each do |article| %> | |
<h1><%= article.title %></h1> | |
<p><%= article.post %></p> |
This file contains 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
class Admin::ProductsController < ApplicationController | |
def index | |
@admin_products = Admin::Product.paginate(:page => params[:page], :per_page => 10) | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @admin_products } | |
end | |
end | |
end |
This file contains 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
// codigo html | |
<%= will_paginate(@admin_products) %> |
This file contains 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
Instalando o RVM | |
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
Para instalar a versão do ruby basta verificar como "rvm list" | |
Para instalar uma versão, exemplo: | |
rvm install 1.9.3 |
This file contains 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
Arquivo para carregar automaticamente o Pry | |
necessário as gems: | |
pry, pry-doc, awesome_print | |
begin | |
require "pry" | |
Pry.start | |
exit |
This file contains 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
INSERT INTO `your_db`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('5', 'admin', MD5('password'), 'admin', '[email protected]', 'http://www.yoursite.com', '2011-06-15 00:00:00', '', '0', 'Admin'); | |
INSERT INTO `your_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}'); | |
INSERT INTO `your_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_user_level', '10'); |
This file contains 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
UPDATE wp_options | |
SET option_value = REPLACE(option_value, 'http://localhost', 'http://www.seudomino.com') | |
WHERE option_name = 'home' | |
OR option_name = 'siteurl'; | |
UPDATE wp_posts | |
SET guid = REPLACE (guid, 'http://localhost', 'http://www.seudomino.com'); | |
UPDATE wp_posts | |
SET post_content = REPLACE (post_content, 'http://localhost', 'http://www.seudomino.com'); |
This file contains 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
cd /path/to/your/repo | |
curl https://gist.github.com/ssaunier/8704755/raw/pre-push.sh > .git/hooks/pre-push | |
chmod u+x .git/hooks/pre-push |
OlderNewer