Skip to content

Instantly share code, notes, and snippets.

View Mehonoshin's full-sized avatar
💪
Working hard

Stanislav Mekhonoshin Mehonoshin

💪
Working hard
View GitHub Profile
@Mehonoshin
Mehonoshin / test.rb
Created October 24, 2016 12:18 — forked from servzin/test.rb
class BasketController
def add_to_basket
item = Item.find_by_title(params[:item_title])
basket = $basket
basket.add_item(item)
if basket.count_items > 10
basket.error_messages.add("Слишком много товаров в корзине")
@Mehonoshin
Mehonoshin / gist:9871192
Last active January 20, 2018 21:39 — forked from dmexe/gist:1508019
Git workflow

После установки

Указываем свое имя и почту

git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com

Настраиваем себе shell чтобы показывал как минимум текущий бранч, а лучше ставим себе zsh и oh-my-zsh с гит плагином.

$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete