Skip to content

Instantly share code, notes, and snippets.

View nandomoreirame's full-sized avatar
🎧
Working from home

Fernando Moreira nandomoreirame

🎧
Working from home
View GitHub Profile
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
find . -name "node_modules" -exec rm -rf '{}' +
find . -name ".git" -exec rm -rf '{}' +
sudo zip -r backup-desktop-dd-mm-YYYY.zip ./
@nandomoreirame
nandomoreirame / gist:45002f9ed0b243266e97
Created October 14, 2015 16:04
set fish shell PATH
set -gx PATH YOUR/PATH/HERE $PATH
@nandomoreirame
nandomoreirame / virtualhost.sh
Created October 31, 2015 04:11
Bash Script to easy create or delete apache virtual hosts on ubuntu
# Bash Script to easy create or delete apache virtual hosts on ubuntu
# https://github.com/RoverWire/virtualhost
# Instalation
sudo su
cd /usr/local/bin
wget -O virtualhost https://raw.githubusercontent.com/RoverWire/virtualhost/master/virtualhost.sh
chmod +x virtualhost
# Usage
@nandomoreirame
nandomoreirame / find-replace-sql-wp.sql
Created December 16, 2015 15:41 — forked from celsofabri/find-replace-sql-wp.sql
SQL Query para fazer um simples localizar e substituir / SQL Query to do a simple find and replace
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_image = replace(link_image, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_usermeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com');
/*UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl' OR option_name = 'widget_text' OR option_name = 'dashboard_widget_options';*/
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com');
/*
Usage
.container {
width: 1200px;
@include media(min-width 480px) {
font-size: 1.2rem;
}
@nandomoreirame
nandomoreirame / travis.sh
Last active December 24, 2015 17:14
travis encrypt GH_TOKEN
travis encrypt GH_TOKEN=<secret token here> --add
$ sudo apt-get install ruby ruby-dev -y
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
$ \curl -sSL https://get.rvm.io | bash -s stable
$ rvm requirements
$ rvm install ruby
$ rvm use ruby --default
$ rvm rubygems current
@nandomoreirame
nandomoreirame / gist:ada7d4ca279dab7350b7ae4fc37c4b1e
Created July 18, 2016 22:46
Update all permalinks in WordPress
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com');
UPDATE wp_links SET link_url = replace(link_url, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com','http://newdomain.com');
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com');
@nandomoreirame
nandomoreirame / Rakefile
Created September 16, 2016 17:36
deploy to aws s3 with Rake tasks
require 'aws-sdk'
require 'pathname'
require 'yaml'
CONFIG = {
"distPath" => "public/dist",
"stylesheetsPath" => "public/dist/stylesheets",
"javascriptsPath" => "public/dist/javascripts",
"fontsPath" => "public/dist/fonts"
}