Skip to content

Instantly share code, notes, and snippets.

View MarcosBL's full-sized avatar
:octocat:
Github Advocate

MarcosBL MarcosBL

:octocat:
Github Advocate
View GitHub Profile
@MarcosBL
MarcosBL / palabras.txt
Created January 12, 2016 21:01
Palabras bonitas en gallego
Panxoliña
Fervenza
Caxato
Burbulla
Luscofusco
Verxel
Berce
Xeito
Cuspir
Axóuxere
@MarcosBL
MarcosBL / app-silex.php
Created September 28, 2015 01:15 — forked from ziadoz/app-silex.php
Slim Framework Controller Strategies (Simple/Silex)
<?php
// Silex Style Controllers
class App extends \Slim\Slim
{
public function mount($controller)
{
if (! is_object($controller)) {
throw new \InvalidArgumentException('Controller must be an object.');
}
@MarcosBL
MarcosBL / invoice_gaps.sql
Last active August 29, 2015 14:24
Find invoice number gaps - Buscar huecos en números de facturación
/*
Table name: documentos_facturas
Number field: numero
Sample data numbers: 1, 2, 3, 6, 9
*/
/* Find just the the first gap for invoice number - El número que correspondería al primer hueco */
SELECT MIN(a.numero)+1 AS next_id
FROM documentos_facturas a
@MarcosBL
MarcosBL / compress.php
Created April 26, 2015 17:39
Maximum Compress HTML using weird tricks
<?php
$to_cache = str_replace(array("</option>","</td>","</tr>","</th>","</dt>","</dd>","</li>","</body>","</html>"),"",$to_cache);
$to_cache = preg_replace('/(href|src|id|class|name|type|rel|sizes|lang|title|itemtype|itemprop)=(\"|\')([^\"\'\`=<>\s]+)(\"|\')/i', '$1=$3', $to_cache);
@MarcosBL
MarcosBL / gist:fefdd5ba5c3551500ee5
Created March 8, 2015 00:21
A list of domains for disposable and temporary email addresses
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@MarcosBL
MarcosBL / odoo_install.sh
Last active August 29, 2015 14:16
Install Odoo - Ubuntu 14.04
#!/bin/bash
# CONFIG HERE
OE_USER="odoo"
OE_HOME="/opt/$OE_USER"
OE_HOME_EXT="/opt/$OE_USER/$OE_USER-server"
OE_VERSION="8.0" # 8.0, 7.0, saas-4, saas-5, "master"
OE_SUPERADMIN="superadminpassword"
OE_CONFIG="$OE_USER-server"
# /CONFIG HERE
@MarcosBL
MarcosBL / converting-mysql-database-contents-to-utf8
Created October 27, 2014 00:58
Converting MySQL Database Contents to UTF-8
# Do a loop with your database tables that creates commands like this, it will force the conversion automatically
ALTER TABLE `name` MODIFY COLUMN `title` VARCHAR(255) CHARACTER SET binary;
ALTER TABLE `name` MODIFY COLUMN `title` VARCHAR(255) CHARACTER SET utf8;
@MarcosBL
MarcosBL / converting-mysql-database-contents-to-utf8
Created October 27, 2014 00:56
Converting MySQL Database Contents to UTF-8
# First create a dump of your MySQL database
mysqldump -u [user] -p database_name > database_name.sql
# Convert the data
iconv -f iso-8859-15 -t utf8 database_name.sql > database_name_iconv.sql
# Import the database
mysql -u [user] -p database_name < database_name_iconv.sql
# If you still have some specific characters that do not display
setInterval(function () {
var change = {};
$('#box span').each(function () {
var $this = $(this),
key = $this.css('background-color');
if (!(key in change)) {
change[key] = {
'element': $this,
@MarcosBL
MarcosBL / .htaccess
Created July 10, 2014 11:40
Apache header write for serving fonts to firefox cross domain and avoid CORS
<FilesMatch ".(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>