I hereby claim:
- I am tuliofaria on github.
- I am tuliofaria (https://keybase.io/tuliofaria) on keybase.
- I have a public key ASBtdOZxrex_iwwZ3G_u7rPDHbxZKU7cj6Chrb1MywCSXQo
To claim this, I am signing this object:
regionFrom = (lat, lon, distance) => { | |
distance = distance/2 | |
const circumference = 40075 | |
const oneDegreeOfLatitudeInMeters = 111.32 * 1000 | |
const angularDistance = distance/circumference | |
const latitudeDelta = distance / oneDegreeOfLatitudeInMeters | |
const longitudeDelta = Math.abs(Math.atan2( | |
Math.sin(angularDistance)*Math.cos(lat), | |
Math.cos(angularDistance) - Math.sin(lat) * Math.sin(lat))) |
const express = require('express') | |
const path = require('path') | |
const app = express() | |
const port = process.env.PORT || 3000 | |
const mysql = require('mysql') | |
const connection = mysql.createConnection({ | |
host:'127.0.0.1', | |
port:'8889', | |
user:'root', | |
password:'root', |
const sleep = time => new Promise(resolve => setTimeout(resolve, time)) | |
const teste = async() => { | |
console.log('ola') | |
await sleep(1000) | |
console.log('depois do sleep') | |
} | |
teste() |
I hereby claim:
To claim this, I am signing this object:
const mdns = require('mdns') | |
const Client = require('castv2-client').Client | |
const DefaultMediaReceiver = require('castv2-client').DefaultMediaReceiver | |
const playMedia = host => { | |
const client = new Client() | |
client.connect(host, () => { | |
console.log('connected') | |
client.launch(DefaultMediaReceiver, (err, player) => { |
const mdns = require('mdns') | |
const browser = mdns.createBrowser(mdns.tcp('googlecast')) | |
browser.on('serviceUp', service => { | |
const { md, fn } = service.txtRecord | |
console.log(md, fn) | |
}) | |
browser.on('serviceDown', service => { | |
const { md, fn } = service.txtRecord | |
console.log(md, fn) |
mongodump --uri "mongodb://<user>:<passwd>@<server1>:27017,<server2>:27017,<server3>:27017/<dbName>?ssl=true&replicaSet=<replicaSetName>&authSource=admin" |
const crypto = require('crypto') | |
const alg = 'aes-256-ctr' | |
const pwd = 'abcdabcdabcdabcdabcdabcdabcdabcd' | |
function crypt(text){ | |
const iv = crypto.randomBytes(16) | |
const cipher = crypto.createCipheriv(alg, pwd, iv) | |
const crypted = cipher.update(text, 'utf8', 'hex') + cipher.final('hex') | |
return iv.toString('hex')+':'+crypted | |
} |
const fs = require('fs') | |
const crypto = require('crypto') | |
const alg = 'aes-256-ctr' | |
const passwd = 'abcdabcd' | |
const read = fs.createReadStream('input.txt') | |
const write = fs.createWriteStream('output.txt') | |
const cipher = crypto.createCipher(alg, passwd) |