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 / media-moda-y-mediana.py
Created September 28, 2017 23:52
Repasando conceptos básicos | Estadística
import statistics as stats
numbersMean = [1525, 257, 378, 9543, 7854, 152]
numbersMode = [9, 5, 9, 4, 3, 6, 7, 1, 2, 3, 9, 1, 2]
numbersMedian = [9, 5, 9, 4, 3, 6, 7, 1, 2, 3, 9, 1, 2]
print(stats.mean(numbersMean))
print(stats.mode(numbersMode))
@calvimor
calvimor / Setup of Development Environment.md
Created September 25, 2017 13:41
Setup of Development Environment wiht blockchain
@calvimor
calvimor / php.ini
Created September 22, 2017 14:53
Variables php ini for working with WordPress
max_execution_time=500
post_max_size=50M
upload_max_filesize=50M
@calvimor
calvimor / net core spa template
Last active September 11, 2017 17:27
net core spa template
mkdir Demoapp
cd Demoapp
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*
dotnet new angular
dotnet restore
npm install
@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

@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 / 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
** 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 / 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)';
@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