Skip to content

Instantly share code, notes, and snippets.

View MurzNN's full-sized avatar
🎯
Focusing

Alexey Murz Korepov MurzNN

🎯
Focusing
View GitHub Profile
@DiesIrae
DiesIrae / cascadeDelete.ts
Last active March 22, 2022 20:10
Abstract Cascade Delete Hook for Keystone 6
// "@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"],
@hagemann
hagemann / blocksToHtml.js
Last active October 27, 2022 08:11
Render EditorJS blocks to HTML.
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
*/
@molomby
molomby / Keystone 5 - Secure Cookies and Reverse Proxies.md
Created March 31, 2020 05:52
Background and instructions for fixing cookie issues encountered when deploying Keystone 5 apps behind a reverse proxy (like nginx)

Keystone 5: Secure Cookies and Reverse Proxies

Can't sign in, eh?

TL;DR

When...

  • Keystone sessions are being used (eg. for authentication)
  • secureCookies Keystone config is true (the default when NODE_ENV is 'production')
@MurzNN
MurzNN / element-web-update.sh
Last active October 21, 2021 16:43
element-web-update.sh - bash script for auto-update web version of Element IM to latest version from GitHub vector-im/element-web project releases
#!/bin/bash
###################################################################
# Script for check new version of Element from github
# and download new version, if update is avaiable
#
# https://gist.github.com/MurzNN/ee64f98ab2e71b886c41d55594e5dd9e
#
###################################################################
@alfianmalik
alfianmalik / README.MD
Last active December 11, 2021 22:59
how to install protobuf + grpc + php on ubuntu

Hello, i am try to install protobuf + grpc + php, here is how i do

sudo apt install php-dev protobuf-compiler protobuf-compiler-grpc
sudo pecl channel-update pecl.php.net
sudo pecl install grpc protobuf

sudo -i
cd /etc/php/7.1/mods-available  
echo "extension=protobuf.so" &gt; protobuf.ini
@adrianlzt
adrianlzt / sharescreen
Last active January 7, 2022 07:14
Scripts to share only a portion of the screen
#!/bin/bash
# Modified version of https://github.com/Ashark/hliss/blob/master/vlc-hangouts
# Script to share a portion of the screen in VLC to be used by Chrome/Firefox to share the screen
# By default, when run, it asks to click in some window. The area of that window is what is going to be shared.
# If executed with "sharescreen area", it asks for a portion of the screen to be shared.
unset x y w h
# Old code to choose a monitor
@andriyun
andriyun / drupal8-change-active-theme-programmatically.php
Last active November 22, 2022 19:56
Drupal 8 switch active theme programmatically
<?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');
@meysam-mahmoodi
meysam-mahmoodi / kubernetes-uninstall.md
Last active April 12, 2024 18:50
Kubernetes completely uninstall

Kubernetes completely uninstall

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>

Setting a default color scheme (tint) for Riot on your account

Caution: This requires some amount of technical knowledge about how matrix/riot works.

For reference, the original grey color scheme in Riot had a primary color of #595959 and a secondary color of #ececec

  1. Open the developer tools by typing /devtools
  2. Click the "Explore Account Data" button
  3. Click the "im.vector.web.settings" button (if you don't have this button, use the instructions below instead)
@stecman
stecman / _readme.md
Last active December 26, 2017 20:47
List BTRFS subvolume and snapshot sizes like df