Skip to content

Instantly share code, notes, and snippets.

View matheusgontijo's full-sized avatar

Matheus Gontijo matheusgontijo

View GitHub Profile
@RaVbaker
RaVbaker / readme.md
Created March 30, 2012 20:12
[HOWTO] Rewrite all urls to one index.php in Apache

Redirect All Requests To Index.php Using .htaccess

In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:

Simple Example

This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

@ashsmith
ashsmith / .gitignore
Last active April 22, 2022 00:06
Magento 1.x .gitignore
# Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev"
app/etc/local.xml
downloader
# If you'd like to keep the downloader, use the following instead:
# downloader/.cache
# downloader/cache.cfg
# downloader/connect.cfg
# All of the var folders can be excluded.
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@fwaechter
fwaechter / gist:8795472
Created February 4, 2014 00:45
PyAudio Example: Make a wire between input and output (i.e., record a few samples and play them back immediately).
"""
PyAudio Example: Make a wire between input and output (i.e., record a
few samples and play them back immediately).
This is the callback (non-blocking) version.
"""
import pyaudio
import time
@kelvinst
kelvinst / local-gitignore.md
Last active April 17, 2024 21:39
Como fazer um .gitignore local?

Como fazer um .gitignore local?

Bom, este é um recurso, como muitos outros, bem escondido do git. Então resolvi fazer um post para explicar a situação em que pode-se usar e como fazer essa magia negra. 👻

O problema

Você provavelmente já adicionou algum dia um arquivo no projeto que não deveria ser commitado certo? E como você fez para ignorar esse arquivo mesmo? Provavelmente adicionou no arquivo .gitignore.

OK então, aí você commitou esse arquivo .gitignore e pronto, mais ninguém poderá criar um arquivo com o mesmo nome e commitar. Mas espera aí! Não era isso que você queria! Você só queria ignorar esse arquivo na sua máquina, se alguém, algum dia por obséquio achar esse um nome bom para seu arquivo, que assim seja.

@splendidinternet
splendidinternet / magento-ce-1.9.1.0-swatchfix.patch
Created March 26, 2015 09:59
Patch for Magento 1.9.1.0 swatches image swap
diff --git a/skin/frontend/rwd/default/js/configurableswatches/product-media.js b/skin/frontend/rwd/default/js/configurableswatches/product-media.js
index 17fd81f..5726200 100644
--- a/skin/frontend/rwd/default/js/configurableswatches/product-media.js
+++ b/skin/frontend/rwd/default/js/configurableswatches/product-media.js
@@ -65,8 +65,11 @@ var ConfigurableMediaImages = {
});
});
+ compatibleProducts.sort();
+
@AllThingsSmitty
AllThingsSmitty / script-loaded.js
Created May 5, 2015 13:25
Check if any given script has loaded
var myScript = document.createElement('script');
myScript.src = 'http://code.jquery.com/jquery-2.1.4.min.js';
myScript.onload = function() {
console.log('jQuery loaded.');
};
document.body.appendChild(myScript);
@thbar
thbar / outdated.exs
Created June 18, 2015 07:32
Running a command and capturing output with Elixir
# not sure how yet to capture the output and stream it back
IO.puts "Calling..."
{ output, exit_code } = System.cmd("bundle", ["outdated"])
IO.puts "Exit code is #{exit_code}"
IO.puts "Output is #{output}"
@tuxmartin
tuxmartin / socket_client.py
Last active April 11, 2020 20:38
Python socket - server and client example (push notifications)
import socket
host = 'localhost'
port = 1234
buf = 1024
clientsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
clientsocket.connect((host, port))
print "Sending 'test1\\n'"
@markshust
markshust / data-install-0.0.0.1.php
Created July 9, 2015 12:39
update magento static block programmatically through upgrade scripts
<?php
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$connection = $installer->getConnection();
$identifier = 'id-goes-here';
$title = 'Title Goes Here';