Skip to content

Instantly share code, notes, and snippets.

View calvimor's full-sized avatar

Carlos Alberto Villamizar Morantes calvimor

View GitHub Profile
@calvimor
calvimor / wp-install.sh
Created March 9, 2017 18:47 — forked from cballou/wp-install.sh
Handle a near auto-installation of Wordpress on Ubuntu 14.04.
#!/bin/bash
# MySQL database defaults
dbname="wordpress"
dbuser="wordpress"
# Gather user info
read -r -p "Enter your domain, e.g. mywebsite.co (no http://, no www.): " wpURL
read -r -p "Enter a secure MySQL root password to use (save this somewhere): " rootpass
read -r -p "Enter a secure MySQL WordPress password to use: " userpass
@calvimor
calvimor / comando para cambiar usuario y grupo
Created March 16, 2017 02:33
comando para evitar que wordpress pida datos de conexión FTP
sudo chown -R www-data:www-data /var/www
@calvimor
calvimor / azure-cli commandos
Last active March 17, 2017 01:47
demo angular JS en azure
// https://docs.microsoft.com/en-us/azure/app-service-web/scripts/app-service-cli-deploy-local-git
=> az login
=> az appservice web deployment user set --user-name [YOUR USERNAME] --password [YOUR PASSWORD]
{
"id": null,
"kind": null,
"location": null,
"name": "web",
"publishingPassword": null,
"publishingPasswordHash": null,
@calvimor
calvimor / azure-cli bash deployment
Created March 17, 2017 02:08
deploy a web app in azure with azure-cli bash
#!/bin/bash
gitdirectory=<Replace with path to local Git repo>
username=<Replace with desired deployment username>
password=<Replace with desired deployment password>
webappname=mywebapp$RANDOM
# Create a resource group.
az group create --location westeurope --name myResourceGroup
@calvimor
calvimor / common component blueprint options
Last active April 10, 2017 17:10
Options to configure the angular CLI
OPTION ALIAS DESCRIPTION
--flat Should a folder be created?
--inline-template -it Will the template be in the .ts file?
--inline-style -is Will the style be in the .ts file?
--spec Generate a spec?
--view-encapsulation -ve View encapsulation strategy
--change-detection -cd Change detection strategy
--dry-run -d Report the files, don’t write them
@calvimor
calvimor / null-coalesce-operator.php
Last active April 18, 2017 02:03
what's new in php 7
<?php
if(isset($_GET['name'])) {
$name = $_GET{'name'];
}
else {
$name = '(unknown)';
}
//Other option to get name
$name = $_GET['name'] ?: '(unknown)';
** Install Salis MVC Framework **
npm install sails -g
** Creata a new directory for the project **
** Create sails api project into new folder ** with this command ```sails new -no-frontend
** Run Sails app ** with command ```sails lift
** Create a user api ** with ```sails generate api user
@calvimor
calvimor / installation.md
Last active May 3, 2017 23:59
angular cli

Requirement //6.9.1 or higher

##Installing the Angular CLI
```npm install –g @angular/cli

##Verifying the Angular CLI Version
```ng -v
@calvimor
calvimor / wordpress-change-domain-migration.sql
Created September 8, 2017 13:08 — forked from chuckreynolds/wordpress-change-domain-migration.sql
Use this SQL script when changing domains on a WordPress site. Whether you’re moving from an old domain to a new domain or you’re changing from a development domain to a production domain this will work. __STEP1: always backup your database. __STEP2: change the ‘oldsite.com’ and ‘newsite.com’ variables to your own. __STEP3: make sure your databa…
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
/* only uncomment next line if you want all your current posts to post to RSS again as new */
#UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@calvimor
calvimor / git commands in forked repos.md
Created September 11, 2017 16:47
git commands in forked repository (upstream and origin)

Crear ó entrar a la carpeta del proyecto $ git remote add origin [HTTPS ó SSH del proyecto forked] $ git remote add upstream [HTTPS ó SSH del proyecto principal] $ git fetch upstream $ git merge origin/upstream $ git fetch origin $ git merge origin/master Hacer cambios en local $ git fetch upstream $ git merge origin/upstream