Skip to content

Instantly share code, notes, and snippets.

/*
In Gitbox (gitboxapp.com) there is a stage view on the right where you can see
a list of all the changes in the working directory: untracked, modified,
added, deleted, renamed files. Each change has a checkbox which you can click
to stage or unstage the change ("git add", "git reset").
When the change staging finishes, we run another task to load all the changes
("git status").
When the loading task is completed we notify the UI to update the list of changes.
All tasks are asynchronous.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@BekoBou
BekoBou / tmux.md
Created November 27, 2013 16:25 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@BekoBou
BekoBou / config.fish
Created February 19, 2014 17:29
Config for fish shell
# name: clearance
# ---------------
# Based on idan. Display the following bits on the left:
# - Virtualenv name (if applicable, see https://github.com/adambrenecki/virtualfish)
# - Current directory name
# - Git branch and dirty state (if inside a git repo)
function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
@BekoBou
BekoBou / Browsersync.md
Last active November 10, 2016 19:29
Установка Browsersync на macOS с помощью homebrew

Устанавливаем Browsersync

Для начала настроим и запустим. У меня рабочая директория WWPass/journal2/chroot/static/ и файл tinymce.html — ты подставь свои, но в общем вот так. Далее приведу полную процедуру установки и настройки простого проекта.

# устанавливаем Node.js и вместе с ним установится npm
~ > brew update ; brew upgrade ; brew install nodejs

# устанавливаем Browsersync с помощью npm
~ > npm install -g browser-sync
@BekoBou
BekoBou / mongohelp.py
Created November 23, 2016 13:57
MongoDB connection helper
# from mongohelp import Connection
# db = Connection().database_name
# print repr(db.collection.find_one())
# db = Connection('example.com:37017').database_name
# print repr(db.collection.find_one())
# db = Connection(
# ('s1.example.com, s2.example.com'),
@BekoBou
BekoBou / iframe.html
Created December 2, 2016 22:28
Убегаем из ifame
<html>
<body>
<script type='text/javascript'>
if (parent.document.location.href == document.location.href)
document.location.href = 'https://yandex.ru';
}
</script>
</body>
</html>
@BekoBou
BekoBou / Issue.md
Last active May 26, 2017 01:38
Жук картинкоед

Жук картинкоед

В проекте «Угадай мелодию» закрался баг. В стили в адресах для картинок затесались абсолютные пути, поэтому локально все будет работать хорошо, а на gh-pages (при публикации) непременно потеряются картинки.

Что надо сделать?

  • Забрать все изменения в локальный мастер
  • Создать из мастера новую ветку image-beetle
  • Поправить абсолютные пути на относительные
@BekoBou
BekoBou / main.js
Created June 13, 2017 23:54
#3 Начинаем программировать
const mainContainer = document.querySelector(`div.app section.main`);
const template = document.querySelector(`#templates`);
const screens = [
template.content.querySelector(`.main--welcome`),
template.content.querySelector(`.main--level-genre`),
template.content.querySelector(`.main--level-artist`),
template.content.querySelectorAll(`.main--result`)[0],
template.content.querySelectorAll(`.main--result`)[1]
];
@BekoBou
BekoBou / guess-melody.example.data.json
Last active June 20, 2017 20:10
Пример данных для проекта «Угадай Мелодию», в боевом проекте данные и структура отличаются.
[
{
"type":"guess-artist",
"src":"https://freemusicarchive.org/music/listen/97489d0e37ce1c46d89a4df577a08a1ba7a864f4",
"options":[
{
"img":"https://freemusicarchive.org/file/images/artists/Quantum_Jazz_-_20120509113401114.jpg?width=300&height=300",
"name":"Quantum Jazz",
"isRight":false
},