Skip to content

Instantly share code, notes, and snippets.

View jotapepinheiro's full-sized avatar
🏠
Working from home

João Paulo Pinheiro jotapepinheiro

🏠
Working from home
View GitHub Profile
@jotapepinheiro
jotapepinheiro / Ext.ux.form.HtmlLintEditor.js
Created March 14, 2012 14:36 — forked from iguigova/Ext.ux.form.HtmlLintEditor.js
ExtJS HtmlEditor extension to support copy and paste from MS Word
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns('Ext.ux.form');
/**
<table class="form-table">
<tr class="form-field">
<th><label for="category_color">Category color</label></th>
<td>
<input id="category_color" type="text" name="category_color" value="<?php echo $current_color ?>" />
<span class="description">
Category Color.</span>
</td>
</tr>
var anchors = document.querySelectorAll('a');
[].forEach.call(anchors, function(e) {
e.addEventListener('click', function(evt) {
var link = this.href,
text = this.innerHTML;
// do some amazing stuff here =)
console.log(link, text);

DigitalOcean - Instalação do Apache 2.4.x + PHP 5.5.x no Ubuntu 13.10


Update e LocalTime São Paulo

sudo apt-get update
sudo dpkg-reconfigure tzdata
#!/bin/sh
# Script para instalação e configuração do Phalcon | MongoDB
echo "#####################################################################"
echo "#####################################################################"
echo "#####################################################################"
echo ">>>>>>>>>>>>>>>>>>>>>> Instalando MongoDB >>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "#####################################################################"
echo "#####################################################################"
server {
listen 80;
server_name laravel.dev;
root /var/www/vhosts/laravel.dev/public;
index index.html index.htm index.php;
charset utf-8;
location / {
@jotapepinheiro
jotapepinheiro / gist:53077dc8ad5522f82385
Created December 2, 2015 13:33
.htaccess redirect wp-content/uploads folder to subdomain
.htaccess
# Re-direct wp-content/uploads to subdomain
RewriteRule wp-content/uploads/(.*) http://uploads.example.com/$1 [R=301,L]
wp-config.php
// Make sure that we put uploads in the right place
update_option(
'upload_url_path',
'http://uploads.aubreypwd.com'
);
@jotapepinheiro
jotapepinheiro / wget-download-ftp-recursive-folder
Created December 2, 2015 13:39 — forked from mikedamoiseau/wget-download-ftp-recursive-folder
How to download a folder with all its content recursively using wget
Use this command line:
wget -r -nH --cut-dirs=3 -nc --ftp-user=jfc-ftp --ask-password ftp://jfc.bitbakers-kunden.de//htdocs/wp-content/uploads
And give the password. Better to use --ask-password so that the password is not saved in the history of the bash
@jotapepinheiro
jotapepinheiro / zipfolders.sh
Last active December 3, 2015 00:29 — forked from icaoberg/zipfolders.sh
Compactar pastas .sh
#!/bin/sh
# Corrigir /bin/sh^m bad interpreter no such file or directory
# dos2unix *.sh
cd /home/proja380/public_html/wp-content/uploads/
caminho=2012
echo 'Compactando pasta '$caminho;
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(