Skip to content

Instantly share code, notes, and snippets.

View HugoJBello's full-sized avatar
🎯
Focusing

Hugo J. Bello HugoJBello

🎯
Focusing
View GitHub Profile
@HugoJBello
HugoJBello / main.go
Created August 5, 2019 15:55
flatten array script
package main
import (
"fmt"
"errors"
)
func main(){
arrayExample := []interface{}{1, []interface{}{2, 3}, []interface{}{[]interface{}{4}}, []interface{}{5, []interface{}{6}}}
result, _ := flattenArray(arrayExample)
@HugoJBello
HugoJBello / puppeteer-rasp-minimal-example.js
Created November 13, 2018 16:25
puppeteer-rasp-minimal-example.js
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
await browser.close();
})();
@HugoJBello
HugoJBello / chromium-browser-65-and-codecs.sh
Last active November 22, 2018 09:48
chromium-browser-65-and-codecs.sh
wget http://launchpadlibrarian.net/361669485/chromium-browser_65.0.3325.181-0ubuntu0.14.04.1_armhf.deb; sudo dpkg -i chromium-browser_65.0.3325.181-0ubuntu0.14.04.1_armhf.deb
wget http://launchpadlibrarian.net/361689926/chromium-codecs-ffmpeg_65.0.3325.181-0ubuntu0.16.04.1_armhf.deb; sudo dpkg -i chromium-codecs-ffmpeg_65.0.3325.181-0ubuntu0.16.04.1_armhf.deb
@HugoJBello
HugoJBello / install-debian-dependencies-raspbian.sh
Created November 13, 2018 16:19
install-debian-dependencies-raspbian.sh
#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
@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-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`
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']
})
for (var number of array){
//do something
}
@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;