Skip to content

Instantly share code, notes, and snippets.

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

José R. Salas Montañez JRSalasM

🏠
Working from home
View GitHub Profile
@JRSalasM
JRSalasM / file.js
Created December 29, 2020 05:20
JS - años, meses, días de una fecha
const date_entry = moment(value.fch_ingreso, "YYYY-MM-DD");
const date_cese = moment(liquidation.date_cese, "YYYY-MM-DD");
let years = Math.trunc(date_cese.diff(date_entry, "years", true));
let months = Math.trunc(date_cese.diff(date_entry, "months", true) - years * 12);
let days = Math.round(
(date_cese.diff(date_entry, "months", true) - years * 12 - months) * 30.4167
);
console.log(`${years} año(s) ${months} mes(es) ${days} dia(s)`);
@JRSalasM
JRSalasM / app.js
Created November 13, 2020 05:46 — forked from shimondoodkin/app.js
node.js express integrated with socket io, also with mysql and basic auth.
/**
* Module dependencies.
*/
var io = require('socket.io')
, sio, sio_client_on
, express = require('express')
, MemoryStore = express.session.MemoryStore
, routes = require('./routes')
, sessionStore = new MemoryStore();
@JRSalasM
JRSalasM / file.json
Created September 12, 2020 01:24
Odoo - Configuración para vscode
// C:\\Users\\JRSalasM\\AppData\\Local\\Programs\\Python\\Python37-32\\python.exe
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Odoo",
"type": "python",
@JRSalasM
JRSalasM / file.txt
Created September 3, 2020 21:51
publicacion appstore
1. Cuenta apple
2. Genera un perfil en tu cuenta
3. Genera un certificado y asigna los permisos que requiere tu aplicacion movil.
4. Descarga el certificado
5. Ejecuta el comando flutter build ios
6. Abre el proyecto ios workspace con xcode
7. Importa el certificado
8. Cumple con las normas de apple, icono, capturas, permisos, etc, en tu info.plist
9. Genera un Archive desde xcode
10. Sube el compilado a tu cuenta de apple.
@JRSalasM
JRSalasM / file.txt
Last active August 12, 2020 04:09
EXTRAER MINIATURA DE YOUTUBE
http://i3.ytimg.com/vi/8nZ3W-GCX3g/maxresdefault.jpg
@JRSalasM
JRSalasM / ip.js
Created August 5, 2020 03:34 — forked from szalishchuk/ip.js
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@JRSalasM
JRSalasM / AppServiceProvider.php
Created August 3, 2020 07:00
LARAVEL - Redifinir carpeta public para archivos
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Setting;
use App\Proyect;
class AppServiceProvider extends ServiceProvider
{
@JRSalasM
JRSalasM / file.php
Created June 6, 2020 08:02
LARAVEL - TRANSACTION REGISTER
public function store(Request $request)
{
//Reglas de los datos
$rules=[];
//Mensaje de error
$msj=[];
//Validacion de los datos, reglas y mensajes
$this->validate($request,$rules,$msj);
//Variable de error
$error = null;
@JRSalasM
JRSalasM / nginx.conf
Created June 5, 2020 15:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@JRSalasM
JRSalasM / file.txt
Last active June 4, 2020 19:50
TEMPLATE REACT
https://themeforest.net/item/skote-react-admin-dashboard-template/26318700
Skote - React Admin & Dashboard Template