Skip to content

Instantly share code, notes, and snippets.

<?php
declare(strict_types=1);
namespace Paysera;
interface TaskOutputInterface
{
public function getOutput(int $num): string;
}
@palamar
palamar / magento_2_disable_cusomer_attribute_admin.xml
Last active September 29, 2023 08:05
Magento 2, disable cusomer's attribute in admin
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="customer">
<field name="attribute_name">
<settings>
<disabled>true</disabled>
</settings>
</field>
</fieldset>
</form>
@palamar
palamar / test.js
Created August 22, 2022 11:26
test
#test
$WSLHOSTNAME = wsl hostname -I
netsh interface portproxy delete v4tov4 listenport=9000 listenaddress=0.0.0.0
netsh interface portproxy add v4tov4 listenport=9000 listenaddress=0.0.0.0 connectport=9003 connectaddress=$WSLHOSTNAME
@palamar
palamar / xml-path-to-tree.php
Last active November 28, 2017 11:01
The easiest way to convert XML path to a tree in PHP
<?php
$tree = '';
$path = '/some/very/deep/path/';
$parts = explode('/', $path);
$reverseSortedParts = array_reverse($parts);
foreach($reverseSortedParts as $part) {
if ($part !== '') {
$tree = [$part => $tree];
@palamar
palamar / gist:9a1a153c2b448968938e3d67564cd1f7
Created May 31, 2016 16:30 — forked from rikh42/gist:efad95142b1be3429a94
Laravel Homestead XDebug Nginx and Composer config changes

Laravel Homestead XDebug Nginx and Composer config changes

/etc/nginx/fastcgi_params

Update nginx config to support a longer timeout to prevent it dropping the connection when trying to debug in PHP Storm

fastcgi_read_timeout 600; # Set fairly high for debugging
@palamar
palamar / sh
Created April 26, 2016 11:19
Coping assets instead of symlinking
diff --git a/app/etc/di.xml b/app/etc/di.xml
index 06c6c4c..5482df0 100755
--- a/app/etc/di.xml
+++ b/app/etc/di.xml
@@ -600,7 +600,7 @@
<virtualType name="developerMaterialization" type="Magento\Framework\App\View\Asset\MaterializationStrategy\Factory">
<arguments>
<argument name="strategiesList" xsi:type="array">
- <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink</item>
+ <item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
@palamar
palamar / pr.md
Last active August 29, 2015 14:13 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: