Skip to content

Instantly share code, notes, and snippets.

View cristiannsc's full-sized avatar

Cristian Sepúlveda cristiannsc

View GitHub Profile
@cristiannsc
cristiannsc / fileUtilsController.java
Created September 28, 2022 01:39
Java file utils controller
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@cristiannsc
cristiannsc / fileUtilsService.java
Created September 28, 2022 01:34
Java file utils Service
import com.example.dtibackendgradle.NoSQL.repository.FileDcaEtcRepository;
import com.example.dtibackendgradle.NoSQL.util.FileDcaEtc;
import com.example.dtibackendgradle.Sql.model.Documento;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletContext;
@cristiannsc
cristiannsc / example.java
Created August 23, 2022 20:07
Java consume API
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
class ExecuteCode {
@cristiannsc
cristiannsc / Mini guía de desarrollo.md
Last active May 24, 2022 23:17
Mini guía de desarrollo

Flujo de Trabajo

Gitflow

Usaremos un sistema de ramificacion llamado gitflow, usando una herramienta para git llamada HubFlow. Instalen Hubflow según la guía de la siguiente pagina.

  • En primer lugar clonamos el repo con: git clone <repo>
  • Inicializamos gitflow
    • git hf init
import React, { Component } from "react";
import { Grid, Row, Col, Table, Button, Modal, Pager, Form, FormGroup, FormControl, ControlLabel } from "react-bootstrap";
import ReactLoading from 'react-loading';
class ListaDesafios extends Component {
constructor(props, context){
super(props, context);
this.state = {
_id:0,
@cristiannsc
cristiannsc / script.sh
Last active October 28, 2018 00:23
script de configuración meneame
#!/bin/bash
# -*- ENCODING: UTF-8 -*-
## Update the ubuntu/debian box
echo "Installing PHP...\n"
sudo apt-get update && apt-get upgrade
sudo apt-get install nginx php7.2-fpm php7.2-common php-memcache\
php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-cgi \
php7.2-mysql php7.2-cli php7.2-zip php7.2-curl php7.2-bcmath -y
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
<?php
$globals['site_name'] = 'Prueba';
$globals['db_server'] = '127.0.0.1';
$globals['db_name'] = 'meneame';
$globals['db_user'] = 'meneame';
$globals['db_password'] = 'meneame';
$globals['static_server'] = '';
$globals['recaptcha_public_key'] = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI';
$globals['recaptcha_private_key'] = '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe';
?>
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
set $script $1;
fastcgi_index index.php;
fastcgi_intercept_errors off;
fastcgi_split_path_info ^(.+\.php)(.*)$;
include fastcgi_params;
@cristiannsc
cristiannsc / default
Last active November 22, 2018 14:01
nginx config meneame
server {
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
#Apuntar a donde está el codigo (descomentar linea siguiente)
#root /path/to/meneame/www;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;