Указываем свое имя и почту
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
Настраиваем себе shell чтобы показывал как минимум текущий бранч, а лучше ставим себе zsh и oh-my-zsh с гит плагином.
| class Movie | |
| attr_accessor :link, :movie, :year, :country, :showing, :jenre, :length, :value, :director, :actor | |
| def initialize(link, movie, year, country, showing, jenre, length, value, director, actor) | |
| @link = link | |
| @movie = movie | |
| @year = year | |
| @country = country | |
| @showing = showing | |
| @jenre = jenre |
| # Add auto-completion and a stored history file of commands to your Python | |
| # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is | |
| # bound to the Esc key by default (you can change it - see readline docs). | |
| # | |
| # Store the file in ~/.pystartup, and set an environment variable to point | |
| # to it: "export PYTHONSTARTUP=~/.pystartup" in bash. | |
| import atexit | |
| import os | |
| import readline |
| require "benchmark" | |
| if ENV['TRACE_GEMS'] | |
| def require(file_name) | |
| result = nil | |
| time = Benchmark.realtime do | |
| result = super | |
| end |
| "address-book", "address-book-o", "address-card", "address-card-o", "bandcamp", "bath", "bathtub", "drivers-license", "drivers-license-o", "eercast", "envelope-open", "envelope-open-o", "etsy", "free-code-camp", "grav", "handshake-o", "id-badge", "id-card", "id-card-o", "imdb", "linode", "meetup", "microchip", "podcast", "quora", "ravelry", "s15", "shower", "snowflake-o", "superpowers", "telegram", "thermometer", "thermometer-0", "thermometer-1", "thermometer-2", "thermometer-3", "thermometer-4", "thermometer-empty", "thermometer-full", "thermometer-half", "thermometer-quarter", "thermometer-three-quarters", "times-rectangle", "times-rectangle-o", "user-circle", "user-circle-o", "user-o", "vcard", "vcard-o", "window-close", "window-close-o", "window-maximize", "window-minimize", "window-restore", "wpexplorer", "address-book", "address-book-o", "address-card", "address-card-o", "adjust", "american-sign-language-interpreting", "anchor", "archive", "area-chart", "arrows", "arrows-h", "arrows-v", "asl-interpretin |
| 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("Слишком много товаров в корзине") |
| #!/usr/bin/env bash | |
| # Drop this file to .git/hooks/post-commit | |
| branch_name=`git symbolic-ref --short HEAD` | |
| retcode=$? | |
| non_push_suffix="_local" | |
| # Only push if branch_name was found (my be empty if in detached head state) | |
| if [ $retcode = 0 ] ; then |
Указываем свое имя и почту
git config --global user.name "Your Name Comes Here"
git config --global user.email [email protected]
Настраиваем себе 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 |
| def koeff | |
| 1.0 / (department.first_semester_seminars_num + department.second_semester_seminars_num + 5) | |
| end | |
| def set_rate_after | |
| if exam_test? && exam_practice? && exam_theory? | |
| self.rate_after = (exam_test*0.1 + exam_practice*0.2 + exam_theory*0.7) * 10 | |
| end | |
| end |
| class A | |
| def initialize | |
| puts self.class::MY_CONSTANT | |
| end | |
| end | |
| class B < A | |
| MY_CONSTANT = "something" | |
| end |