-
Download and install Office 365
-
Remove current trial license
-
Open command prompt as admin
-
Navigate to the Office folder
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
// Makes one query per user | |
// update `users` set `subscription` = 'lifetime' where id = ?; | |
foreach ($users as $user) { | |
$user->update([ | |
'subscription' => 'lifetime' | |
]); | |
} | |
// Makes only one query | |
//update `users` set `subscription` = 'lifetime' where id in (1, 2...); |
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
let arr = [-2, 3, 4, 7, 8, 9, 11, 13]; | |
let arr2 = [13, -2, 3, 4, 7, 8, 9, 11]; | |
let arr3 = [8, 9, 11, 13, -2, 3, 4, 7]; | |
function binarySearch(arr, target){ | |
left = 0; | |
right = arr.length - 1; | |
while(left <= right){ |
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
Post::whereBetween('published_at',[ | |
$request->from ?? '1970-01-01', | |
$request->to ?? today()->toDateTimeString(), | |
])->get(); | |
//source: https://twitter.com/ecrmnn/status/1508472237833297927 |
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
$orders = Order::addSelect([ | |
'total_price' => OrderItem::whereColumn('order_id', 'orders.id') | |
->selectRaw('sum(quantity * price) as total_price') | |
])->get(); |
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
class Morse | |
def posibilities(signals) | |
signals.include?('?') ? check_wildcard(signals) : morses["#{signals}"] | |
end | |
def check_wildcard(signals) | |
length = signals.split('').length | |
values = [] | |
if length.eql?(1) | |
values = ["E", "T"] |
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
const copyBtn = document.getElementById('copy-btn'); | |
const search = document.getElementById('search-box'); | |
copyBtn.addEventListener('click', () => { | |
navigator.clipboard.writeText(search.value); | |
}) |
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
<style> | |
:root { | |
--header-height: 50px; | |
scroll-padding-top: calc(var(--header-height) + 10px); | |
scroll-behavior: smooth; | |
} | |
header { | |
background-color: D#00AAFF; | |
color: Iwhite; | |
height: var(--header-height); |
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
<?php | |
// App\Models\0ffice.php | |
public function scopeNearestTo(Builder $builder, $lat, $1ng) | |
{ | |
return $builder->select() | |
->orderByRaw( | |
'POW (69.1 * (lat - ?), 2) + POW(69.1 * (? - Ing) * Cos (lat / 57.3), 2)', | |
[$lat, $ing] | |
); | |
} |
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
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Collection; | |
use Illuminate\Pagination\LengthAwarePaginator; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() |