Skip to content

Instantly share code, notes, and snippets.

View ALEXOTANO's full-sized avatar
🎯
Focusing

Alex Otano ALEXOTANO

🎯
Focusing
View GitHub Profile
<invoice id="1234">
<customer name="John Doe" taxID="123456789" />
<total currency="USD" symbol="$" symbolOnRight="false">100.00</total>
</invoice>
{
"id": "1234",
"customer": {
"name": "John Doe",
"taxID": "123456789"
},
"total": {
"amount": 100.00,
"currency": "USD",
"currency-symbol": "$",
{
"id": "1234",
"customer": {
"name": "John Doe",
"taxID": "123456789"
},
"total": {
"amount": 100.00,
"currency": {
"name": "USD",
<invoice id="1234">
<customer name="John Doe" taxID="123456789" />
<total currency="USD">100.00</total>
</invoice>
@ALEXOTANO
ALEXOTANO / medium.JSONvsXML.json
Last active May 1, 2021 23:09
medium.JSONvsXML
{
"id": "1234",
"customer": {
"name": "John Doe",
"taxID": "123456789"
},
"total": {
"amount": 100.00,
"currency": "USD"
}
@ALEXOTANO
ALEXOTANO / RemoveNthNodeFromEndofList.js
Created February 18, 2021 01:41
Remove Nth Node From End of List
class LinkedList {
constructor(){
this.head = null;
}
removeNode(index2Remove) {
if(index2Remove == 0){
this.head = this.head.next;
return
@ALEXOTANO
ALEXOTANO / Two-Sum-javascript.js
Last active February 17, 2021 23:13
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
for(var i = 0; i < nums.length; i++){
var n = nums[i]
@ALEXOTANO
ALEXOTANO / Valid-Palindrome.php
Last active February 18, 2021 13:01
Check if a string is a valid palindrome
<?php
class Solution {
/**
* @param String $s
* @return Boolean
*/
function isPalindrome($s) {
if(! isset($s)) return false;
@ALEXOTANO
ALEXOTANO / node-arguments.js
Created August 8, 2020 12:35
How to create a nodejs script that read arguments passed through the CLI in the form of '--arg=data'
/**
* Author: Alex Otano
* This is a implementation of how to get parameters from the CLI when running a nodejs script.
* In this case "node-arguments.js --user=myuser --pass=secretPassword" and the script will read them.
*/
console.log('---------------------');
let pass = ''
let user = ''
console.log('process.argv',process.argv)
@ALEXOTANO
ALEXOTANO / configure-ubuntu-ftp-using-vsftp-TLS.md
Created June 8, 2020 14:57
Configure FTP on Ubuntu using VSFTP and TLS

How to correctly configure FTP on ubuntu

1. Install FTP Service

sudo apt-get update
sudo apt install vsftpd

2. Backup config file