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 python3 | |
from datetime import date, datetime | |
import json | |
from pathlib import Path | |
import os | |
import sys | |
from urllib.request import Request, urlopen, urlretrieve |
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
#cloud-config | |
users: | |
- name: hw | |
shell: /bin/bash | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
ssh_import_id: | |
- gh:hussainweb | |
disable_root: true | |
package_update: true | |
package_upgrade: true |
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
// ==UserScript== | |
// @name Suspend Disable-Devtool (simple approach) | |
// @namespace https://www.tampermonkey.net/ | |
// @version 0.1 | |
// @description suspend https://github.com/theajack/disable-devtool | |
// @author hussainweb | |
// @match {site} | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=gist.github.com | |
// @grant none | |
// ==/UserScript== |
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 python3 | |
from datetime import date, datetime | |
import json | |
from pathlib import Path | |
import os | |
import sys | |
from urllib.request import Request, urlopen, urlretrieve |
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 | |
// in src/Form directory. | |
namespace Drupal\mymodule\Form; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\system\Form\SiteInformationForm; | |
/** |
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 | |
// Run this as follows: | |
// php import-xhprof-to-xhgui.php -d /dir/to/xhprof/runs/ | |
// | |
// Based on https://github.com/perftools/xhgui/blob/master/external/import.php | |
if (!defined('XHGUI_ROOT_DIR')) { | |
require __DIR__ . '/src/bootstrap.php'; | |
} |
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
drupal_tests: | |
image: hussainweb/drupal-base:php7.3 | |
services: | |
- mariadb:10.3 | |
stage: test | |
tags: | |
- autoscaler | |
variables: | |
SITE_BASE_URL: 'http://localhost' | |
MYSQL_DATABASE: "drupal" |
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 Drupal\my_module\Plugin\Block; | |
use Drupal\Core\Access\AccessResult; | |
use Drupal\Core\Block\BlockBase; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
use Drupal\Core\Session\AccountInterface; | |
use Drupal\node\NodeInterface; | |
use Drupal\my_module_lists\ProfilesService; |
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 Drupal\axl_ks_topics\Plugin\EntityReferenceSelection; | |
use Drupal\Component\Utility\Html; | |
use Drupal\Core\Database\Connection; | |
use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\Core\Entity\Query\QueryInterface; | |
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; |
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 php | |
<?php | |
$environments = explode("\n", `platform environments --columns=title,status --format=tsv --no-header | grep -v "\tInactive" | awk "{print \\$1}"`); | |
$remote_branches = explode("\n", `git ls-remote --heads | awk "{ print \\$2 }" | sed 's/refs\\/heads\\///'`); | |
$environments = \array_diff($environments, [ | |
"Master", | |
"develop", | |
"qa", |
NewerOlder