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
defmodule MyApp.Accounts.Checks.Can do | |
use Ash.Policy.SimpleCheck | |
def describe(_opts) do | |
"Check if a user/ actor has permission on a specific resource" | |
end | |
# @impl true | |
def match?(nil, _, _), do: false |
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
# In your test classes. For example OnboardTransporterAPITest.py | |
================================================================= | |
import requests_mock | |
from rest_framework import status | |
from django.urls import include, path, reverse | |
from rest_framework.test import APITestCase, URLPatternsTestCase | |
@requests_mock.Mocker() | |
class OnboardTransporterAPITest(APITestCase, URLPatternsTestCase): |
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 as EloquentModel; | |
class Model extends EloquentModel | |
{ | |
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
/** | |
* Sort an HTML TABLE IN DOM element | |
* @usage 1) add #sortable-table-input id to your input and listen to onkeyup event | |
Example: <input id="sortable-table-input" onkeyup="sortTable()" /> | |
2) Add #sortable-table id to your HTML table | |
* @return | |
*/ | |
function sortTable() { | |
// Declare variables | |
var input, filter, table, tableRow, index, rowTextValue; |
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
GRANT SELECT ON ceb.loans TO user@'%'; | |
FLUSH PRIVILEGES; |
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
var server = "Your DATABASE HOST"; | |
var databaseName = "DATABASE NAME"; | |
var username = "password"; | |
var password = "Username"; | |
var port = 3306; | |
/** | |
* Open network to Database | |
*/ | |
function openConnection() { |
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 Exception; | |
trait EloquentRoutePaths { | |
/** | |
* Actions that are allowed to be performed on this | |
* Model | |
* @var array | |
*/ |
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
use Exception; | |
trait EloquentRoutePaths { | |
/** | |
* Actions that are allowed to be performed on this | |
* Model | |
* @var array | |
*/ | |
protected $actions = ['show','edit','update','destroy']; |
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
<div class="card col-md-8"> | |
<div class="cart-header"> | |
<span class="card-title">Today </span> | |
<span class="dot dot-red"></span> Line red: <span class="text-red-600"> 0 RWF</span> | |
<span class="dot dot-yellow"></span> Line green: <span class="text-yellow-600"> 0 RWF </span> | |
</div> | |
<div class="card-body"> | |
<canvas id="transactionsChart" ></canvas> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit backupGlobals="false" | |
backupStaticAttributes="false" | |
bootstrap="../../../wp-load.php" | |
colors="true" | |
convertErrorsToExceptions="true" | |
convertNoticesToExceptions="true" | |
convertWarningsToExceptions="true" | |
processIsolation="false" | |
stopOnFailure="false"> |
NewerOlder