Skip to content

Instantly share code, notes, and snippets.

View fronzec's full-sized avatar
:octocat:

Eduardo Flores fronzec

:octocat:
View GitHub Profile
@fronzec
fronzec / medium-my-awesome-project-app-config.properties
Last active April 14, 2021 03:24
application.properties file
## Application configuration
# We customize our application context path
server.servlet.context-path=/api/my-awesome-service
## Database Properties, our props values must be injected through env variables
spring.datasource.url=jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_NAME}
spring.datasource.username=${DB_USER}
spring.datasource.password=${DB_PASS}
spring.datasource.driver-class-name=org.postgresql.Driver
@fronzec
fronzec / cors.py
Last active September 10, 2018 13:49
Custom cors Middleware Django
# -*- coding:utf-8 -*-
# Put this file under <your_app>/middleware/cors.py
# Edit your setting.py
from django.http import HttpResponse
from django.utils.deprecation import MiddlewareMixin
class CorsMiddleware(MiddlewareMixin):
def process_response(self, request, response):
@fronzec
fronzec / superlog
Created August 17, 2018 18:09 — forked from gollum23/superlog
Superlog Curso git platzi
git config --global alias.superlog "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
@fronzec
fronzec / deploying_to_heroku.md
Created June 26, 2018 23:00 — forked from prodeveloper/deploying_to_heroku.md
Deploying your application to a heroku server

For the lesson today, we are going to deploy our application to a live server.

The current workspace provided by cloud9 is meant only for development and not for production. By that, we mean you can use the service to write and even test your code but not to run your service.

For this we will be using a platform called heroku. Heroku is a PAAS (Platform As A Service).

This means you will not need to work VMs and such. Heroku will work with your code as long as you push it, which do using a similar technique.

The main things to consider when hosting your code will be:

@fronzec
fronzec / RsaExample.java
Created June 16, 2017 17:50 — forked from nielsutrecht/RsaExample.java
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
@fronzec
fronzec / ToonDeferredShading2017.shader
Created May 22, 2017 22:44 — forked from xDavidLeon/ToonDeferredShading2017.shader
Unity 5.6 Deferred Cel Shading Modification
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Modifications by David Leon. Copyright (c) 2017 Lince Works SL. MIT license (see license.txt)
Shader "ToonDeferredShading2017" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1
@fronzec
fronzec / ToonDeferredShading2017.shader
Created May 22, 2017 22:44 — forked from xDavidLeon/ToonDeferredShading2017.shader
Unity 5.6 Deferred Cel Shading Modification
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Modifications by David Leon. Copyright (c) 2017 Lince Works SL. MIT license (see license.txt)
Shader "ToonDeferredShading2017" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1
@fronzec
fronzec / _service.md
Created March 22, 2017 16:25 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@fronzec
fronzec / GenerateSimplePdfReportWithJasperReports.java
Created June 8, 2016 20:49 — forked from rponte/GenerateSimplePdfReportWithJasperReports.java
Example on how to generate a simple pdf report with JasperReports
package rponte.report;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import net.sf.jasperreports.engine.JRException;