Skip to content

Instantly share code, notes, and snippets.

@acrispin
acrispin / repository_pattern.py
Created May 26, 2024 19:15 — forked from Greyvend/repository_pattern.py
Repository pattern implementation in Python
"""
This is Python implementation of Repository pattern for accessing Data model
in an Object Oriented manner, simulating collection interface and abstracting
persistence operations.
The Repository also has Factory method for dealing with different Databases. Another
approach is to add direct engine string ingestion to the Repository __init__ method.
"""
from abc import ABC
@acrispin
acrispin / nginxproxy.md
Created October 23, 2020 18:34 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

package com.unicon.api.pedido.proxy;
import com.unicon.api.pedido.beans.proxy.EstadoPedidoBean;
import com.unicon.api.pedido.beans.proxy.EstadoPedidoResponseBean;
import com.unicon.api.pedido.beans.proxy.ResponseAuthExternoBean;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Header;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.unicon.eta.bs.beans;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
@acrispin
acrispin / unix
Created December 1, 2019 17:29 — forked from xero/unix
curl -L git.io.unix
,_ ,_==▄▂
, ▂▃▄▄▅▅▅▂▅¾. / /
▄▆<´ "»▓▓▓%\ / / / /
,▅7" ´>▓▓▓% / / > / >/%
▐¶▓ ,»▓▓¾´ /> %/%// / /
▓▃▅▅
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@acrispin
acrispin / TestUtc.java
Created January 26, 2018 06:01
Test Utc Java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.console.test;
import java.text.DecimalFormat;
import java.util.TimeZone;
@acrispin
acrispin / postgresql_date_function_index_howto.md
Created January 3, 2018 05:58 — forked from cobusc/postgresql_date_function_index_howto.md
Short explanation of the issues faced when trying to create a PostgreSQL index using the date() function and how to resolve it.

Given a table...

CREATE TABLE foo (
  id SERIAL PRIMARY KEY,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  ...
);
@acrispin
acrispin / gmail_imap_dump_eml.py
Created October 11, 2017 20:04 — forked from robulouski/gmail_imap_dump_eml.py
Very simple Python script to dump all emails in an IMAP folder to files.
#!/usr/bin/env python
#
# Very simple Python script to dump all emails in an IMAP folder to files.
# This code is released into the public domain.
#
# RKI Nov 2013
#
import sys
import imaplib
import getpass