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
# Laravel Artisan Alias | |
function artisan { | |
param ( | |
[string]$Command | |
) | |
php artisan $Command | |
} |
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
# PowerShell 7.3.1 Profile | |
# Posh Git | |
Import-Module posh-git | |
$omp_config = "atomic" # Themes atomic, takuya, material, jandedobbeleer | |
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/$omp_config.omp.json" | Invoke-Expression | |
# Terminal Icons | |
Import-Module -Name Terminal-Icons |
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
onMouseMove(event) { | |
this.mouse.x = (event.clientX / window.innerWidth) * 2 - 1; | |
this.mouse.y = - (event.clientY / window.innerHeight) * 2 + 1; | |
// Make the sphere follow the mouse | |
var vector = new THREE.Vector3(this.mouse.x, this.mouse.y, 0.5); | |
vector.unproject( this.camera ); | |
var dir = vector.sub( this.camera.position ).normalize(); | |
var distance = - this.camera.position.z / dir.z; | |
var pos = this.camera.position.clone().add( dir.multiplyScalar( distance ) ); |
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
import React from "react" | |
import PropTypes from "prop-types" | |
import classNames from "classnames" | |
import "./Container.scss" | |
const Container = ({ sm, md, lg, xl, xxl, fluid, ...props }) => { | |
let styles = { | |
"container-sm": sm, | |
"container-md": md, | |
"container-lg": lg, |
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
$this->validate($request, [ | |
'phone' => 'required|digits:10' | |
]); | |
$this->validate($request, [ | |
'phone' => 'required|numeric|between:9,11' | |
]); | |
$this->validate($request, [ | |
'phone' => 'required|min:10|numeric' |
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
this.$svgCircle = document.querySelector("circle"); | |
this.circumference = 2 * Math.PI * this.$svgCircle.getAttribute("r"); | |
setCircleProgress(amount) { | |
let res = amount * this.circumference / 100 + ", " + this.circumference; | |
this.$svgCircle.setAttribute("stroke-dasharray", res) | |
} |
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
// ========================================================================== | |
// ReleaseDownload Progress Bar | |
// ========================================================================== | |
import AbstractObject from './AbstractObject'; | |
export default class ReleaseDownload extends AbstractObject { | |
constructor(el, options) { | |
super(el, options); | |
this.el = el; |
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
/* | |
|-------------------------------------------------------------------------- | |
| Tailwind configuration | |
|-------------------------------------------------------------------------- | |
*/ | |
const mix = require('laravel-mix'); | |
const tailwindcss = require('tailwindcss') | |
mix.js('resources/frontend/scripts/app.js', 'public/js/app.js'); |
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/env node | |
const puppeteer = require('puppeteer'); | |
/** | |
* npm link/savepage url=https://stackoverflow.com/ | |
* Margins default to Microsoft Word A4 margins. | |
*/ | |
class SavePage { |
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
function combinations(n) { | |
if (n < 0) { | |
return 0; | |
} else if (n < 3) { | |
return n; | |
} | |
return n * (n - 1) * (n - 2); | |
} | |
console.log(combinations(8)) // (8 - 1 = 7) * (8 - 2 = 6) = (42 * 8) = 336 |
NewerOlder