Skip to content

Instantly share code, notes, and snippets.

@jachanga
jachanga / App.svelte
Created April 12, 2021 17:30
Svelte very simple fetch data
<!--
npx degit sveltejs/template name-project
cd name-project
npm install
npm run dev
-->
<script>
import { onMount } from 'svelte';
let items;
@jachanga
jachanga / docker-compose.yml
Created January 20, 2021 09:17
Portainer behind Traefik and Letsencrypt Certificate
version: '3'
services:
traefik:
# The official v2 Traefik docker image
image: traefik:v2.3
# Enables the web UI and tells Traefik to listen to docker
command:
- --api.insecure=true
- --providers.docker=true
@jachanga
jachanga / app.js
Created January 20, 2021 09:04
Simple NodeJs Server Static Content
var fs = require('fs'),
http = require('http');
http.createServer(function (req, res) {
if (req.url == "/") req.url = "/index.html";
fs.readFile(__dirname + req.url, function (err,data) {
if (err) {
res.writeHead(404);
res.end(JSON.stringify(err));
return;
@jachanga
jachanga / UploadToBucketS3.java
Created September 11, 2020 09:27
Upload to Bucket Vultr using Amazon S3 Library
/*
* <dependency> <groupId>com.amazonaws</groupId>
* <artifactId>aws-java-sdk-s3</artifactId> </dependency>
*/
public void uploadFileToBucketS3(MultipartFile file, String bucketName, String fileName, Boolean isPrivateFile) {
try {
String ACCESS_KEY_ID = "<ACCESS_KEY_ID>";
String SECRET_ACCESS_KEY = "<SECRET_ACCESS_KEY>";
@jachanga
jachanga / index.html
Created September 11, 2020 08:42
Create Excel from Table in Javascript
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
table,
th,
td {
@jachanga
jachanga / application.properties
Created January 14, 2020 17:54
Logging Spring Boot
#....................#
spring.jpa.show-sql=true
#....................#
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
spring.jpa.properties.hibernate.format_sql=true
@jachanga
jachanga / index.html
Created April 16, 2018 10:25
Component Easy. AngularJS Version 1.6.9.
<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app="ngApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Component Easy. AngularJS Version 1.6.9. </title>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
</head>
<body>
<div ng-controller="newCtrl">
<h1>{{top}}</h1>
@jachanga
jachanga / index.html
Created April 16, 2018 09:34
Calling http. Simple ng-repeat. AngularJS Version 1.6.9.
<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app="ngApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Calling http. Simple ng-repeat. AngularJS Version 1.6.9. </title>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
</head>
<body>
<div ng-controller="newCtrl">
<ul>
@jachanga
jachanga / index.html
Created April 16, 2018 09:24
Simple start. AngularJS Version 1.6.9
<!doctype html>
<html xmlns:ng="http://angularjs.org" ng-app="ngApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Simple start. AngularJS Version 1.6.9</title>
<script src="https://code.angularjs.org/1.6.9/angular.js"></script>
</head>
<body>
<div>
I can add 1+2 = {{ 1+2 }}.
@jachanga
jachanga / index.html
Last active April 16, 2018 09:10
Simple AngularJS Start. Simple Controller
<!--https://bl.ocks.org/jachanga-->
<!doctype html>
<html ng-app="myApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Simple Sum Angular (Simple Sample. Simple Controller)</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.1/angular.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">