Skip to content

Instantly share code, notes, and snippets.

View MurzNN's full-sized avatar
🎯
Focusing

Alexey Murz Korepov MurzNN

🎯
Focusing
View GitHub Profile
@mrded
mrded / foo.module
Created October 31, 2013 13:46
Drupal: Taxonomy terms as autocomplete using form API.
<?php
function bar_form($form, &$state) {
$form['bar'] = array(
'#type' => 'textfield',
'#title' => t('Bar'),
'#autocomplete_path' => 'taxonomy/autocomplete/field_bar_term', // Field name here.
'#element_validate' => array('foo_taxonomy_autocomplete_validate'),
);
@stecman
stecman / _readme.md
Last active December 26, 2017 20:47
List BTRFS subvolume and snapshot sizes like df
@tetrapus
tetrapus / color-tabs.css
Last active July 2, 2018 13:20
Coloured tabs for TST
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* override base tab color */
:root:root {
--color-100: white;
}
/* Plain */
.tabbrowser-tab {
--color-main: var(--color-100);

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)
# This should be the public-facing name (ie: dns name)
HOME_SERVER_URL="https://matrix.org"
# The room ID is NOT the room alias. The ID can be found at the bottom of the room settings dialog in riot-web
ROOM_ID="!AbCDef823s:matrix.org"
# This is your user ID and access token. The access token must match the user.
USER_ID="@turt2live:matrix.org" # The home server should match this domain as well (ie: t2l.io as a HS should be :t2l.io in the user)
ACCESS_TOKEN="token_here"
@sanks
sanks / yandex-maps-example.js
Last active April 2, 2021 07:44
Getting user region and city with Yandex.Maps API
ymaps.ready(function () {
ymaps.geolocation.get({ provider: 'yandex' }).then(function(result) {
var data = result.geoObjects.get(0).properties.get('metaDataProperty').GeocoderMetaData;
var administrativeAreaName = data.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName; // region
if ('SubAdministrativeArea' in data.AddressDetails.Country.AdministrativeArea) {
var localityName = data.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName; // city
} else {
var localityName = data.AddressDetails.Country.AdministrativeArea.Locality.LocalityName; // city
@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