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
const jq = { | |
get() { return jQuery; }, | |
set() { }, | |
}; | |
Object.defineProperty(window, '$', jq); | |
Object.defineProperty(window, 'jQuery', jq); |
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
// npm i --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser | |
module.exports = { | |
root: true, | |
parser: '@typescript-eslint/parser', | |
plugins: [ | |
'@typescript-eslint', | |
], | |
extends: [ | |
'plugin:@typescript-eslint/recommended', | |
'react-app', |
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 (!function_exists('get_query_with_bindings')) { | |
function get_query_with_bindings($query): string | |
{ | |
$sql = $query->toSql(); | |
$replace = '?'; | |
$replaceLength = strlen($replace); | |
foreach ($query->getBindings() as $binding) { | |
if (!is_int($binding)) { |
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 | |
# run with sudo -H | |
HELP="Missing params\nsudo -H bash pgAdmin.sh <user> <host>" | |
APACHE_SITES="/etc/apache2/sites-available" | |
USER=${1} | |
if [[ -z ${USER} ]]; then | |
echo -e ${HELP} |
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
[Unit] | |
Description=Pgadmin4 Service | |
After=network.target | |
[Service] | |
User= root | |
Group= root | |
# Point to the virtual environment directory | |
WorkingDirectory=__VENV_PATH__ | |
# Point to the bin folder of your virtual environment |
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
<VirtualHost *:80> | |
ServerName | |
WSGIDaemonProcess pgadmin processes=1 threads=25 python-home=__VENV_PATH__ | |
WSGIScriptAlias / /opt/pgAdmin4/web/pgAdmin4.wsgi | |
<Directory /opt/pgAdmin4/web> | |
WSGIProcessGroup pgadmin | |
WSGIApplicationGroup %{GLOBAL} | |
Require all granted |
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 | |
// assume | |
Route::resource('groups.students', 'StudentController'); | |
// Instead of this | |
route('groups.students.show', ['group' => $group->id, 'student'=> $student->id]); | |
// use this | |
route('groups.students.show', [$group, $student]); |
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\Routing\RouteRegistrar@group instead of Illuminate\Routing\Router@group | |
*/ | |
Route::domain('') | |
->middleware('') | |
->namespace('Product') | |
->prefix('products') | |
->as('products.') |
NewerOlder