Recomendações gerais de artigos e palestras sobre desenvolvimento e de frameworks.
Tópicos:
export interface Vector3 { | |
x: number; | |
y: number; | |
z: number; | |
} | |
export function get3DPointFromSphere(phi: number, theta: number) { | |
const coordinates = {x: 0, y: 0, z: 0}; | |
coordinates.x = Math.sin(theta) * Math.cos(phi); |
const Scene = () => { | |
const texture = useTexture(image); | |
const camera = useThree(({ camera }) => camera); | |
return ( | |
<> | |
<OrbitControls | |
camera={camera} | |
minZoom={1} | |
maxZoom={1} |
import { Canvas } from '@react-three/fiber'; | |
import { useTexture } from '@react-three/drei'; | |
import { DoubleSide, Vector3 } from 'three'; | |
import image from './panorama.jpg'; | |
import { Suspense } from 'react'; | |
const Scene = () => { | |
const texture = useTexture(image); |
import { Canvas } from '@react-three/fiber'; | |
function App() { | |
return ( | |
<div style={{ width: '100vW', height: '100vH', background: '#723983' }}> | |
<Canvas camera={{ | |
near: 1, | |
far: 1100, | |
aspect: 16 / 9, | |
fov: 70 |
$app->register(App\Providers\RollbarServiceProvider::class); | |
$app->configure('logging'); |
<?php | |
namespace App\Providers; | |
use Illuminate\Contracts\Config\Repository; | |
use Illuminate\Support\ServiceProvider; | |
use Rollbar\RollbarLogger; | |
use Rollbar\Rollbar; | |
use Monolog\Handler\RollbarHandler; | |
use Monolog\Logger; |
<?php | |
return [ | |
'default' => env('LOG_CHANNEL', 'stack'), | |
'channels' => [ | |
'stack' => [ | |
'driver' => 'stack', | |
'channels' => ['rollbar'], | |
], | |
'rollbar' => [ |
export const createColorFromName = (name, saturation = 30, lightness = 60) => { | |
if (name.length === 0) return hash; | |
const nameHash = name.split('').reduce((hash, letter, i) => { | |
hash = name.charCodeAt(i) + ((hash << 5) - hash) | |
return hash & hash | |
}, 0); | |
return `hsl(${nameHash % 360}, ${saturation}%, ${lightness}%)`; |
Recomendações gerais de artigos e palestras sobre desenvolvimento e de frameworks.
Tópicos:
export function promisifyAll(classToPromisify) { | |
const props = Object.getOwnPropertyNames(Object.getPrototypeOf(classToPromisify)); | |
const fns = props.sort().filter((e, i, arr) => { | |
return e !== arr[i + 1] && e !== 'constructor' && typeof classToPromisify[e] === 'function'; | |
}); | |
fns.forEach((e) => { | |
classToPromisify[`${e}Async`] = (...args) => new Promise((resolve, reject) => { | |
return classToPromisify[e].call(classToPromisify, ...args, (err, data) => { |