Skip to content

Instantly share code, notes, and snippets.

View amalitsky's full-sized avatar
⛰️
Climb the mountain

Alexander Malitsky amalitsky

⛰️
Climb the mountain
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 25, 2025 19:14
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jvandyke
jvandyke / .gitconfig
Last active January 27, 2023 08:11
Use PHPStorm/WebStorm for git diff and merge tools
# ~/.gitconfig
# Add this to your global git configuration file
# Change phpstorm to webstorm, if you use that.
# Diff and merge tool changes
# Run `git difftool <directory/file>...` or `git mergetool <directory/file>...`
[merge]
tool = phpstorm
[diff]
tool = phpstorm
@benstr
benstr / readme.md
Created January 31, 2014 22:11
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

@kentcdodds
kentcdodds / get-watchers.js
Last active December 4, 2023 22:34
Get Watchers of element and its children
function getWatchers(root) {
root = angular.element(root || document.documentElement);
var watcherCount = 0;
function getElemWatchers(element) {
var isolateWatchers = getWatchersFromScope(element.data().$isolateScope);
var scopeWatchers = getWatchersFromScope(element.data().$scope);
var watchers = scopeWatchers.concat(isolateWatchers);
angular.forEach(element.children(), function (childElement) {
watchers = watchers.concat(getElemWatchers(angular.element(childElement)));
@gubatron
gubatron / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Last active October 12, 2024 22:57
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.

@bmhatfield
bmhatfield / .profile
Last active August 9, 2025 20:28
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@samwhitehall
samwhitehall / apple-keyboard-ubuntu.md
Last active September 14, 2019 20:28
Apple Keyboard on Ubuntu 16.04
  1. use English (UK, Macintosh) as the base keyboard layout

  2. https://help.ubuntu.com/community/AppleKeyboard#Ubuntu_11.10_up_to_recent (steps 1,2,3) to fix wrong keys (§± and `~)

  3. dconf-editor org.gnome.desktop.input-sources.xkb-options ~> ['lv3:lalt_switch', 'lv3:ralt_alt']

  4. compizconfig-settings-manager (ccsm)

        desktop > ubuntu unity plugin > general > key to show the menu bar:     
@hotohoto
hotohoto / nodejs_systemctl.md
Created August 23, 2017 05:27
Run Node.js web server via systemctl

Make a configuration file like below at /etc/systemd/system/nodejs_www.service.

[Unit]
Description=My Node.js Web Server

[Service]
ExecStart=/usr/bin/yarn start

WorkingDirectory=/home/hotohoto/app
@debovis
debovis / package.json
Last active January 16, 2024 14:13
How to debug gatsby and reactjs with webstorm
{
"name": "project-name",
"version": "1.0.0",
"description": "",
"main": "n/a",
"scripts": {
"serve": "gatsby develop -p 5000",
"dev": "node $NODE_DEBUG_OPTION ./node_modules/.bin/gatsby develop -p 5000",
}
}
@dima117
dima117 / task.md
Last active September 2, 2021 19:05

Упражнения

  1. Сортировка пузырьком
  2. Сортировка выбором
  3. Сортировка вставками
  4. Обход дерева в глубину
  5. Обход дерева в ширину
  6. Баланс скобок в строке ({[
  7. Найти все простые числа от 1 до N
  8. Бинарный поиск в отсортированном массиве