Skip to content

Instantly share code, notes, and snippets.

View leosuncin's full-sized avatar

Jaime Leonardo Suncin Cruz leosuncin

View GitHub Profile
@leosuncin
leosuncin / machine.js
Last active January 9, 2020 16:31
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
# El nombre de la aplicacion
APP_NAME=rest-app
# Token de acceso de la API de DigitalOcean
DIGITALOCEAN_ACCESS_TOKEN=
# Region de disponibilidad de DigitalOcean
DIGITALOCEAN_REGION=nyc1
# Nombre de usuario de GitHub
GITHUB_USERNAME=leosuncin
# Token de acceso de GitHub
GITHUB_ACCESS_TOKEN=
@leosuncin
leosuncin / Test SSE.md
Created March 8, 2018 23:02
Send Server Event snippets

Test Send Server Event with cURL

curl http://localhost:8080/sse -H Accept:text/event-stream
@leosuncin
leosuncin / symfony.conf
Created February 28, 2018 04:10
Apache2 virtualhost for Symfony application
<VirtualHost *:80>
ServerSignature Off
DocumentRoot "/var/www/symfony/web/"
DirectoryIndex app.php
<Directory "/var/www/symfony/web">
AllowOverride None
        Order Allow,Deny
        Allow from All
@leosuncin
leosuncin / Cipher.js
Created August 10, 2017 22:42
Encrypt and decrypt using crypto
const crypto = require('crypto')
const IV_LENGTH = 16
const KEY_LENGTH = 32
const ALGORITHM = 'aes-256-cbc'
const ENCODING = 'hex'
const _privates = Symbol('privates')
/**
* Encrypt and decrypt text
@leosuncin
leosuncin / colleccion.sql
Last active January 28, 2023 16:43
Resumen de consultas PL/SQL para Oracle
-- Consultar usuarios loggeados
SELECT USERNAME FROM V$SESSION;
-- Consultar el usuario actual
SELECT user FROM dual;
SELECT SYS_CONTEXT('USERENV', 'CURRENT_USER') FROM dual;
-- Consultar la fecha actual
SELECT TO_CHAR (SYSDATE, 'MM-DD-YYYY HH24:MI:SS') "NOW" FROM DUAL;
-- Crear indice
CREATE INDEX
@leosuncin
leosuncin / BAD115-Laboratorio1.ra
Created March 14, 2017 17:09
Esquemas laboratorios BAD115-2017
-- this is an example
group: BAD115-Laboratorio1
R1 = {
A:string, B:string, C:string, D:string
'α','α','1','7'
'α','ß','5','7'
'ß','ß','12','3'
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@leosuncin
leosuncin / JDownloader2.sh
Last active May 28, 2024 09:44
JDownloader 2 headless startup script
#!/bin/sh
DESC="JDownloader 2 Headless"
NAME=JDownloader2
PIDFILE=/var/run/$NAME.pid
COMMAND="/usr/bin/java -- -Djava.awt.headless=true -jar /home/osmc/jDownloader2/JDownloader.jar"
RUN_AS=osmc
d_start() {
start-stop-daemon --start --quiet --background --make-pidfile --pidfile $PIDFILE --chuid $RUN_AS --exec $COMMAND
@leosuncin
leosuncin / sailsService.js
Created July 24, 2015 20:57
Simple angular service for wrap sails.io.js client
'use strict';
/**
* @ngdoc service
* @name yourApp.$sails
* @description
* # $sails
* Service in the yourApp.
*/
angular.module('yourApp')