Skip to content

Instantly share code, notes, and snippets.

View marlonramirez's full-sized avatar
🏠
Working from home

Marlon Ramirez marlonramirez

🏠
Working from home
View GitHub Profile
@marlonramirez
marlonramirez / nginx.conf
Last active December 31, 2015 12:12
Configuración de NGINX para SCOOP
merge_slashes off;
rewrite (.*)//+(.*) $1/$2 permanent;
location /scoop {
root html;
index index.html index.htm index.php;
try_files $uri $uri/ /scoop/?$args @rw-scoop;
expires max;
}
location @rw-scoop {
rewrite ^/scoop/(.*)(/?)$ /scoop/index.php?route=$1&$args? last;
@marlonramirez
marlonramirez / HolidayUtil.java
Last active April 18, 2024 16:33
Gestión de fechas en colombia, días habiles, festivos, etc.
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
public class HolidayUtil {
private int year;
private int easterMonth;
private int easterDay;
private ArrayList<String> holidays;
@marlonramirez
marlonramirez / Backtrack.java
Last active April 9, 2019 19:43
Move process in flowable
package com.mes.berry.controller;
import org.flowable.engine.RuntimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Backtrack {
@Autowired
@marlonramirez
marlonramirez / seamContext.java
Created April 10, 2019 00:15
Abrir contexto de seam con Lifecycle
public Object[] getPrograma () {
Lifecycle.beginCall();
ProgramaafiliadoList programaafiliadoList = (ProgramaafiliadoList) org.jboss.seam.Component
.getInstance(ProgramaafiliadoList.class, true);
Object[] ips = programaafiliadoList.getProgramaafiliadoLstObj1().toArray();
Lifecycle.endCall();
return ips;
}
function setBooleanProp($target, name, value) {
if (value) {
$target.setAttribute(name, value);
$target[name] = true;
} else {
$target[name] = false;
}
}
function removeBooleanProp($target, name) {
@marlonramirez
marlonramirez / deploy.sh
Created July 10, 2025 18:03
Despliegue automatizado para docker compose
#!/bin/bash
set -e
cd /path/to/my/project
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_REGISTRY
MAX_WAIT_SECONDS=300
CHECK_INTERVAL_SECONDS=10
SECONDS_WAITED=0
VAR_NAME_TO_UPDATE=$(echo "${ECR_REPOSITORY%%-*}" | tr 'a-z' 'A-Z')_IMAGE