Skip to content

Instantly share code, notes, and snippets.

View cristianprofile's full-sized avatar

Cristian Romero Matesanz cristianprofile

View GitHub Profile
@cristianprofile
cristianprofile / push-local_git-project.txt
Last active November 6, 2019 19:33
adding-an-existing-project-to-github-using-the-command-line
https://help.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.
Create New Repository drop-down
Open Terminal.
Change the current working directory to your local project.
Initialize the local directory as a Git repository.
$ git init
Add the files in your new local repository. This stages them for the first commit.
$ git add .
@cristianprofile
cristianprofile / gist:9bd520c4f085b84058992b6084bc4980
Created August 13, 2018 09:42
Spring boot and Intellij custom properties autocomplete
Code completion for custom properties in Spring Boot
May 16, 2015
All three major IDEs (IntelliJ IDEA, Eclipse and Netbeans) provide either plugins or built-in features for code completion in application.properties files in a Spring Boot project:
Besides completion, you also see, that all properties are typed (and validated), and if present a Javadoc is shown.
Fortunately this feature can also be used for custom defined properties. There are 2 prerequisites for that:
@cristianprofile
cristianprofile / database_mysql_docker.md
Last active August 2, 2018 09:38
Spring boot docker mysql Admin and index

Spring boot Spring data and mysql docker container:

https://www.youtube.com/watch?v=vO7MNTXxbZ0

docker run --name some-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7.22  (select from docker images with Kitematic)
/**
*
*/
package com.technoactivity.mymo.resource.external;
import com.sun.jersey.api.model.AbstractResource;
import com.sun.jersey.api.model.AbstractResourceMethod;
import com.sun.jersey.api.model.AbstractSubResourceMethod;
import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
import com.technoactivity.mymo.resource.BaseResource;
/**
*
*/
package com.technoactivity.mymo.resource.external;
import com.sun.jersey.api.model.AbstractResource;
import com.sun.jersey.api.model.AbstractResourceMethod;
import com.sun.jersey.api.model.AbstractSubResourceMethod;
import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
import com.technoactivity.mymo.resource.BaseResource;
/**
*
*/
package com.technoactivity.mymo.resource.external;
import com.sun.jersey.api.model.AbstractResource;
import com.sun.jersey.api.model.AbstractResourceMethod;
import com.sun.jersey.api.model.AbstractSubResourceMethod;
import com.sun.jersey.server.impl.modelapi.annotation.IntrospectionModeller;
import com.technoactivity.mymo.resource.BaseResource;
@cristianprofile
cristianprofile / join-command.txt
Last active June 7, 2018 09:07
Join sentence Explanation Sql
Differences between Join commands:
Just typing JOIN performs an INNER JOIN by default.
For all others, one picture is sometimes worth more than hundreds of words. See image bellow post:
thanks to :https://stackoverflow.com/questions/565620/difference-between-join-and-inner-join?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa
@cristianprofile
cristianprofile / gist:9e2adbfae5354cf912f464f00255ced2
Created September 28, 2017 08:27
Añadir una línea a un fichero en unix (add one line in a file unix command)
Añadir una línea a un fichero en unix
add one line in a file unix command
ex -sc '1i|use batchdb' -cx payment.sql
@cristianprofile
cristianprofile / Spring boot data jpa oracle example definition
Created April 28, 2017 07:06
Custom datasource configuration Oracle Database
Warning !!! Be carefull hibernate: ddl-auto value. Not usefull to Production enviroments. Your data could be deleted!!!!!!!!
server:
port: 9090
management:
port: 9091
address: 127.0.0.1
http:
mappers:
@cristianprofile
cristianprofile / gist:fcab3405b8f39e1e69f8
Created April 23, 2015 07:27
spring profiles definition and use
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-generics-as-qualifiers
Environment abstraction
The Environment is an abstraction integrated in the container that models two key aspects of the application environment: profiles and properties.
A profile is a named, logical group of bean definitions to be registered with the container only if the given profile is active. Beans may be assigned to a profile whether defined in XML or via annotations. The role of the Environment object with relation to profiles is in determining which profiles (if any) are currently active, and which profiles (if any) should be active by default.
Properties play an important role in almost all applications, and may originate from a variety of sources: properties files, JVM system properties, system environment variables, JNDI, servlet context parameters, ad-hoc Properties objects, Maps, and so on. The role of the Environment object with relation to properties is to provide the user with