$ sudo mkdir -p /opt/Obsidian
$ mv ~/Downloads/Obsidian-0.13.19.AppImage /opt/Obsidian
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
<?php | |
/** | |
* Example: five_star_rating_stars(4.8); | |
* five_star_rating_stars( | |
* 4.8, | |
* '<i class="fas fa-star"></i>', | |
* '<i class="fas fa-star-half-alt"></i>', | |
* '<i class="far fa-star"></i>' | |
* ); |
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
<?php | |
function change_make($price, $pay) | |
{ | |
if ($price === 0 || $pay === 0 || $price > $pay) { | |
return; | |
} | |
$change = $pay - $price; |
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
<?php | |
use App\Models\Member; | |
abstract class AbstractCalculator | |
{ | |
/** @var self */ | |
private $next = null; | |
/** |
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
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Model; | |
class Media extends Model {} |
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 bash | |
set -euo pipefail | |
# Ref: Ref: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html | |
aws ec2 describe-images \ | |
--owners 099720109477 \ | |
--filters "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-*" \ | |
"Name=architecture,Values=x86_64" \ | |
"Name=virtualization-type,Values=hvm" \ | |
"Name=root-device-type,Values=ebs" |
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
<?php | |
if ( ! wp_roles()->is_role( 'my_customer' ) ) { | |
add_role( | |
'my_customer', | |
__( 'My customer' ), | |
array_merge( | |
wp_roles()->get_role( 'customer' )->capabilities, | |
array( 'read_shop_order', 'read_private_shop_orders' ) | |
) |
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
<?php | |
use Illuminate\Support\Carbon; | |
use Google_Client; | |
use Google_Service_Sheets; | |
use Google_Service_Sheets_Request; | |
use Google_Service_Sheets_ValueRange; | |
use Google_Service_Sheets_BatchUpdateSpreadsheetRequest; | |
class Example |
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
<?php | |
namespace App\Logging; | |
use DateTimeZone; | |
use Monolog\Logger; | |
use App\Logging\TelegramBotHandler; | |
use Monolog\Formatter\LineFormatter; | |
class FooLogger |
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
<?php | |
namespace App\Permissions; | |
class OrderPermissions | |
{ | |
const VIEW = 'view_order'; | |
const VIEW_ANY = 'view_any_orders'; | |
const CREATE = 'create_order'; | |
const UPDATE = 'update_order'; |
NewerOlder