Skip to content

Instantly share code, notes, and snippets.

View HugoJBello's full-sized avatar
🎯
Focusing

Hugo J. Bello HugoJBello

🎯
Focusing
View GitHub Profile
public class UserDaoImpl implements UserDao {
@Override
public boolean isValidUser(String username, String password) {
boolean isValid = false;
EntityManager em = PersistenceManager.INSTANCE.getEntityManager();
UserPK pkToFind = new UserPK();
pkToFind.setUsername(username);
pkToFind.setPassword(password);
try {
@HugoJBello
HugoJBello / .xml
Last active March 22, 2017 08:14
pom.xml java spring mvc forms example
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mvc-forms-example</groupId>
<artifactId>hjbello</artifactId>
<version>0.1.0</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
package com.example;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;
@Controller
public class ServletConfig {
@Bean
public EmbeddedServletContainerCustomizer containerCustomizer() {
@HugoJBello
HugoJBello / .java
Created March 21, 2017 23:54
spring boot application file
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MvcFormsExampleApplication {
public static void main(String[] args) {
SpringApplication.run(MvcFormsExampleApplication.class, args);
@HugoJBello
HugoJBello / .java
Created March 21, 2017 23:55
MvcConfig class spring boot mvc
package com.example;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
for (var number of array){
//do something
}
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Observable } from 'rxjs';
import {AngularFirestore} from 'angularfire2/firestore';
@Component({
selector: 'app-news',
templateUrl: './news.page.html',
styleUrls: ['./news.page.scss']
})
@HugoJBello
HugoJBello / install-packages-google-cloud.sh
Last active October 26, 2018 16:41
install required stuff nodejs server in google cloud engine
# https://medium.com/google-cloud/node-to-google-cloud-compute-engine-in-25-minutes-7188830d884e
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt install nodejs
sudo apt-get install python3-pip
#https://docs.python-guide.org/dev/virtualenvs/#virtualenvironments-ref
pip3 install virtualenv
#virtualenv env
#source env/bin/activate # On Windows use `env\Scripts\activate`
@HugoJBello
HugoJBello / deps-puppetteer-debian9.sh
Last active April 17, 2024 22:25
install dependencies debian 9 puppeteer
# https://medium.com/google-cloud/node-to-google-cloud-compute-engine-in-25-minutes-7188830d884e
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt install nodejs
#install dependencies
#https://github.com/GoogleChrome/puppeteer/issues/290#issuecomment-322838700
sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
@HugoJBello
HugoJBello / install-node-10.sh
Created November 13, 2018 16:12
install-node-10.sh
# https://medium.com/google-cloud/node-to-google-cloud-compute-engine-in-25-minutes-7188830d884e
curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
sudo apt install nodejs