This file contains hidden or 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
| export function distBetweenCoordinates(point1: number[], point2: number[], precision: number = 4): number { | |
| // function to convert degrees to radians | |
| const rad = (deg) => deg * Math.PI / 180; | |
| // Earth radius in km | |
| const EARTH_RADIUS = 6378.137; | |
| let factor = '1'; | |
| for (let i = 1; i < precision; i++) { | |
| factor += '0'; |
This file contains hidden or 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
| function ObjectId() { | |
| const timestamp = (new Date().getTime() / 1000 | 0).toString(16); | |
| const randomize = () => Math.random() * 16 | 0; | |
| const randStr = 'xxxxxxxxxxxxxxxx'.replace(/x/g, () => randomize().toString(16)).toLowerCase(); | |
| return `${timestamp}${randStr}`; | |
| } |
This file contains hidden or 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
| interface IStarBucket { | |
| 1: string[]; | |
| 2: string[]; | |
| 3: string[]; | |
| 4: string[]; | |
| 5: string[]; | |
| } | |
| export function calcFiveStarRating(ratings: IStarBucket) { | |
| let totalWeight = 0; |
This file contains hidden or 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
| function stringWeight(str,encoding,decimals) { | |
| var bytes = Buffer.byteLength( str , encoding || 'utf8' ); | |
| if(bytes == 0) return '0 Bytes'; | |
| var k = 1024, | |
| dm = decimals || 2, | |
| sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], | |
| i = Math.floor(Math.log(bytes) / Math.log(k)); | |
| return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; | |
| } |
This file contains hidden or 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
| Sub Descubrir_contraseña() | |
| Dim a As Integer, b As Integer, c As Integer | |
| Dim d As Integer, e As Integer, f As Integer | |
| Dim a1 As Integer, a2 As Integer, a3 As Integer | |
| Dim a4 As Integer, a5 As Integer, a6 As Integer | |
| On Error Resume Next | |
| For a = 65 To 66: For b = 65 To 66: For c = 65 To 66 | |
| For d = 65 To 66: For e = 65 To 66: For a1 = 65 To 66 | |
| For a2 = 65 To 66: For a3 = 65 To 66: For a4 = 65 To 66 | |
| For a5 = 65 To 66: For a6 = 65 To 66: For f = 32 To 126 |
This file contains hidden or 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
| #common workflow | |
| clone, make branch, commit, return to origin branch, pull, rebase and push. | |
| #For a list of files to be pushed (between git commit and git push) | |
| git diff --stat --cached origin/master |