Skip to content

Instantly share code, notes, and snippets.

View iWatchYouFromAfar's full-sized avatar

Paul iWatchYouFromAfar

View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@iWatchYouFromAfar
iWatchYouFromAfar / packages.php
Created February 25, 2019 06:02 — forked from gvozdb/packages.php
Скрипт автоустановки компонентов в MODX. Работает как из консоли, так и из веба. Скрипт из консоли работает корректно на сервере, настроенном по этой инструкции - https://modx.pro/hosting/678-the-right-hosting-for-modx-revolution-2/
<?php
/*
Скрипт надо запускать от юзера - владельца сайта, чтобы созданные файлы пакетов не принадлежали юзеру root
$ sudo -u USERNAME php /var/www/USERNAME/packages.php /var/www/USERNAME/www/
Или от root, а после выставить владельца:
$ php /root/scripts/modx/packages.php /var/www/USERNAME/www/ && /var/www/USERNAME/chmod
Чтобы запустить из веба, просто положите скрипт в корень или куда-нибудь глубже и вызовите по HTTP
*/
@iWatchYouFromAfar
iWatchYouFromAfar / gist:2896152685a281ae76e2e0376dc5ba3f
Created December 10, 2018 18:23 — forked from pepebe/gist:2483894
MODx: Get all members of a user group in MODx Revolution.
by kairon - http://www.unchi.co.uk/author/admin/
Get all members of a user group in MODx Revolution. This can been done by accessing the database in the following way.
<?php
$usergroup = 4;
$c = $modx->newQuery('modUser');
$c->innerJoin ('modUserProfile','Profile');
$c->innerJoin ('modUserGroupMember','UserGroupMembers');
$c->innerJoin ('modUserGroup','UserGroup','`UserGroupMembers`.`user_group` = `UserGroup`.`id`');
@iWatchYouFromAfar
iWatchYouFromAfar / content-manager.policy.xml
Last active November 30, 2018 13:30
MODX / Политика доступа / Контент-менеджер
<?xml version="1.0" encoding="UTF-8"?>
<policy>
<template>
<name>AdministratorTemplate</name>
<description>Context administration policy template with all permissions.</description>
<lexicon>permissions</lexicon>
<template_group>Admin</template_group>
<permissions>
<permission>
@iWatchYouFromAfar
iWatchYouFromAfar / 1. Дополнения
Last active April 27, 2023 07:24
[Visual Studio Code] My settings
1. Color Highlight
This extension styles css/web colors found in your document
https://marketplace.visualstudio.com/items?itemName=naumovs.color-highlight
2. IntelliSense for CSS class names in HTML
A Visual Studio Code extension that provides CSS class name completion for the HTML class attribute based on the definitions found in your workspace or external files referenced through the link element.
https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion
3. vscode-stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint