Skip to content

Instantly share code, notes, and snippets.

View cagartner's full-sized avatar

Carlos Augusto Gartner cagartner

View GitHub Profile
@cagartner
cagartner / CidadesSeeder.php
Last active August 29, 2015 14:04
Migration e DB Seeding Estados e Cidades do Brasil:
<?php
class Cidades extends Seeder {
public function run()
{
DB::select(DB::raw("INSERT INTO `cidade` (`id`, `nome`, `estado_id`, `created_at`, `updated_at`) VALUES
(1, 'Afonso Cláudio', 8, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP ),
(2, 'Água Doce do Norte', 8, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP ),
(3, 'Águia Branca', 8, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP ),
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<?php
$traducao["bt_novo_anunciante"] = "New Advertiser";
if (!empty($_SESSION['sessao']))
{
echo '<input
name="bt_vermelho"
type="submit"
value='.$traducao['bt_novo_anunciante'].'
>';
@cagartner
cagartner / gist:77b79e59c784be3424f6
Created March 26, 2015 19:11
Exemplo relação n para n Laravel
// Tabela posts
<?php
class Posts extends Eloquent {
public function tags () {
return $this->belongsToMany('Tag');
}
}
// Tabela telephones
@cagartner
cagartner / laravel
Created July 15, 2015 17:06
Config nginx ajenti para magento e laravel
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
client_max_body_size 100m;
@cagartner
cagartner / gist:25c6dc3b42ec1edecdd6
Last active September 30, 2015 18:15 — forked from molotovbliss/gist:2562551
Magento Snippets

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51
@cagartner
cagartner / magento-code-snippets.md
Last active September 30, 2015 18:11 — forked from arosenhagen/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@cagartner
cagartner / table.css
Created August 31, 2015 20:33
Tabelas responsivas com bootstrap
@media only screen and (max-width: 800px) {
/* Force table to not be like tables anymore */
#no-more-tables table,
#no-more-tables thead,
#no-more-tables tbody,
#no-more-tables th,
#no-more-tables td,
#no-more-tables tr {
display: block;
@cagartner
cagartner / magento-mobile-tema
Created September 22, 2015 12:08
Parâmetro para mobile no layout
iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|IEMobile|Safari Mobile|Android|Opera Mini
@cagartner
cagartner / chagen_status_order.sql
Created September 30, 2015 23:09
Mudar status pedido magento
UPDATE sales_flat_order_grid SET status = 'canceled' WHERE increment_id = <order_increment_id>;
UPDATE sales_flat_order SET state='canceled', status='canceled' WHERE increment_id =<order_increment_id>;