Skip to content

Instantly share code, notes, and snippets.

View rafaelstz's full-sized avatar
👨‍🔬

Rafael Corrêa Gomes rafaelstz

👨‍🔬
View GitHub Profile
@rafaelstz
rafaelstz / deploy
Created January 27, 2015 12:37
Auto Deploy
<?php
date_default_timezone_set('America/Sao_Paulo');
class Deploy {
public $post_deploy;
private $_log = 'var/log/deployments.log';
private $_date_format = 'Y-m-d H:i:sP';
private $_branch = 'develop';
@rafaelstz
rafaelstz / SnippetsHtaccess.md
Created March 10, 2015 17:08
Htaccess Snippets A collection of useful .htaccess snippets, all in one place.

.htaccess Snippets

A collection of useful .htaccess snippets, all in one place.

Disclaimer: While dropping the snippet into an .htaccess file is most of the time sufficient, there are cases when certain modifications might be required. Use at your own risk.

IMPORTANT: Apache 2.4 introduces a few breaking changes, most notably in access control configuration. For more information, check the upgrading document as well as this issue.

Credits

What we are doing here is mostly collecting useful snippets from all over the interwebs (for example, a good chunk is from Apache Server Configs) into one place. While we've been trying to credit where due, things might be missing. If you believe anything here is your work and credits should be given, let us know, or just send a PR.

@rafaelstz
rafaelstz / .htaccess
Created March 23, 2015 21:52
Magento Htaccess Optimization
####################################################################
################## Creare's Magento .htaccess File #################
####################################################################
##### Block unwanted Bots that clog the server #####
RewriteCond %{HTTP_USER_AGENT} MJ12bot
RewriteRule .* - [F]
RewriteCond %{HTTP_USER_AGENT} 80legs [NC]
RewriteRule ^ - [F]
@rafaelstz
rafaelstz / robots
Created March 23, 2015 21:54
Magento SEO Robots
########################################################################################
##################### Creare's robots.txt file for Magento websites ####################
########################################################################################
User-agent: *
Allow: /
#Disallow: /
#######################################
############### SITEMAP ###############
@rafaelstz
rafaelstz / js_before_all.md
Created March 25, 2015 18:40
Magento JS Before body and

For Magento v1.5+ (need to test in older versions).

1 - Create an template file in page/html/footer/extras.phtml with this content:

<?php echo $this->getCssJsHtml() ?>

2 - Add this html node to your layout xml:

<reference name="before_body_end">
@rafaelstz
rafaelstz / text_render.md
Last active August 29, 2015 14:18
Text Render CSS - Melhora a renderização de texto.
body,input,textarea,select,button{ 
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  -moz-font-feature-settings:"liga", "kern"
}
.no-fontsmoothing{
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;

}

@rafaelstz
rafaelstz / input_quant.md
Created April 2, 2015 14:19
Input HTML5 de quantidade Product View Magento

Input HTML5 na Product View.

File

app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml

Code

@rafaelstz
rafaelstz / README.md
Last active August 29, 2015 14:19 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@rafaelstz
rafaelstz / permission_server.md
Last active August 29, 2015 14:20
Permissão correta

Permissõa correta!

chown -R _www:_www * # Let apache be owner
# rwxr-xr-x
sudo find . -type d -exec chmod 755 {} \;
# rw-r--r--

sudo find . -type f -exec chmod 644 {} ;