This a gist for quick uninstall kubernetes
If the cluster is node, First delete it from master
kubectl drain <node name> — delete-local-data — force — ignore-daemonsets
kubectl delete node <node name>
// "@keystone-next/types": "^22.0.0", | |
// "@keystone-next/keystone": "^22.0.0" | |
// The actual lib | |
// utils/keystone/cascadeDelete.ts | |
import { ListHooks } from "@keystone-next/types" | |
import { BaseGeneratedListTypes } from "@keystone-next/types/src/utils" | |
type BeforeDeleteType = Exclude< | |
ListHooks<BaseGeneratedListTypes>["beforeDelete"], |
<?php | |
/* | |
echo plural_form(42, array('арбуз', 'арбуза', 'арбузов')); | |
*/ | |
function plural_form($n, $forms) { | |
return $n%10==1&&$n%100!=11?$forms[0]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$forms[1]:$forms[2]); | |
} |
class TestMyObjectLoader extends PHPUnit_Framework_TestCase | |
{ | |
protected $mockObject; | |
public function setUp() | |
{ | |
$this->mockObject = $this->getMockForAbstractClass('Project\MyObject', [], '', true, true, true, ['initialize', '__get']); | |
} | |
const renderHtml = (blocks) => { | |
var html = blocks.map(block => { | |
switch (block.type) { | |
case 'code': | |
return `<pre><code>${ block.data.code }</pre></code>` | |
/** | |
* Original type is 'header' but I renamed the block to follow correct terminology: | |
* https://github.com/editor-js/header/issues/21 | |
*/ |
<?php | |
/** | |
* See original implementation http://cgit.drupalcode.org/mailsystem/tree/src/MailsystemManager.php#n60 | |
*/ | |
// Switch the theme to the configured mail theme. | |
$theme_manager = \Drupal::service('theme.manager'); | |
$mail_theme = '[your theme name]'; | |
$current_active_theme = $theme_manager->getActiveTheme(); | |
if ($mail_theme && $mail_theme != $current_active_theme->getName()) { | |
$theme_initialization = \Drupal::service('theme.initialization'); |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32: