This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const reduce = ([a,...b],fn,initValue)=>a?reduce(b,fn,fn(initValue,a)):initValue | |
const map = (arr,fn)=>reduce(arr,(acc,curr)=>acc.concat(fn(curr,arr)),[]) | |
const filter = (arr,fn)=>reduce(arr,(acc,curr)=>fn(curr)? acc.concat(curr) :acc,[]) | |
const print = console.log | |
/** | |
* @author Thom Maurick Roman Aguilar - [email protected] | |
* @param {arr} es el array para buscar | |
* @param {value} es el element que será el que comprueba | |
* @return La función retornará un array de array | |
* @example ([2,6,8,0,9,-10,-1]) and 8 => [[2,6] ,[8,0],[9,-1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
""" | |
* AUTHOR : https://gist.github.com/IranNeto/21542660d740ac02dfce2f6aeb11ebeb | |
https://github.com/IranNeto | |
* WEB : https://medium.com/analytics-vidhya/implementing-particle-swarm-optimization-pso-algorithm-in-python-9efc2eb179a6 | |
""" | |
# https://code.sololearn.com/cvIleZW1gfC6/#py | |
import random | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const parseJWT = token =>{ | |
let base64URL = token.split('.')[1] | |
let base64 = base64URL.replace('-','+').replace('_','/') | |
return JSON.parse(window.atob(base64)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// test postman | |
let res = pm.response.json(); | |
if(res.ok) { | |
let token = res.token; | |
pm.environment.set("token", token); | |
}else{ | |
console.log('No se actualizó el token'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package com.shoppingcar.model.dao.postgres; | |
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.PreparedStatement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const trampoline = fn => (...args)=>{ | |
let result = fn(...args) | |
while (typeof result === 'function') | |
result = result() | |
return result | |
} | |
const sum = (number,step=0)=>( | |
!number?step:()=>sum(number-1,step+number) | |
) | |
// const tsum = trampoline(sum)(500000) // currying |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch .gitignore && echo "node_modules" >> .gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const coords = navigator.geolocation.getCurrentPosition(position=>{ | |
console.log(position) | |
let coord = position.coords | |
let lat = coord.latitude | |
let long = coord.longitude | |
console.log(lat,long) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const printFullName_1 = <T extends {name:string,lastName:string}>(obj:T)=>({ | |
...obj, | |
fullName:`${obj.name} ${obj.lastName}` | |
}) | |
interface IPerson{ | |
name:string, | |
lastName:string | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Course{ | |
constructor(private _id:number,private _name:string){ | |
} | |
get id(){ | |
return this._id | |
} | |
set id(id:number){ | |
this._id=id | |
} |
OlderNewer