- За основу берём модель ветвления описанную в этой статье
- Про Гит - читать всем
- Из SVN в Git - сравнение с SVN, которое не стоит использовать как руководство к действию.
- Шпаргалка новичка
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './s3-bucket-copier' | |
credentials = { | |
:provider => "AWS", | |
:region => "eu-west-1", | |
:aws_access_key_id => "<KeyId>", | |
:aws_secret_access_key => "<KeySecret>" | |
} | |
connection = ::Fog::Storage.new(credentials) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Годный метод для сериализации в yaml Mail::Message | |
class Mail::Message | |
# @return [String] | |
def to_yaml | |
hash = {} | |
hash['headers'] = {} | |
header.fields.each do |field| | |
hash['headers'][field.name] = field.value | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Установка англо-русского словаря на Ubuntu | |
sudo apt-get install stardict | |
wget http://sourceforge.net/projects/xdxf/files/dicts-stardict-form-xdxf/002c/stardict-comn_sdict05_eng_rus_full-2.4.2.tar.bz2/download | |
tar -xjf download | |
sudo mv stardict-eng_rus_full-2.4.2/ /usr/share/stardict/dic/ | |
sudo chmod -R a+r /usr/share/stardict/dic/ | |
# Спасибо http://forum.ubuntu.ru/index.php?topic=2587 и http://sourceforge.net/projects/xdxf/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A sample Gemfile | |
source "https://rubygems.org" | |
gem "sinatra" | |
gem "sinatra-synchrony" | |
gem "thin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Чистит локальные слитые ветки | |
for i in `git branch | grep "^[^*]\+"`; do git branch -d $i; done; | |
# Чистит слитые ветки в удалённом репозитории | |
git log --pretty=format:%H HEAD~1 > /tmp/git-history.txt | |
for i in `git br -r | grep -o "[^ \/]\+$" | sort | uniq`; | |
do |
В БД есть пользователи и группы, между ними связть многие ко многим, нужно выбрать группы, где есть и Коля и Петя.
- Создайте БД
- Выполните скрипт с паролем qwerty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build/ | |
*.box | |
*.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Событие с полезной нагрузкой | |
* | |
* PHP 5.3 | |
* | |
* Это докблок файла. | |
* Если бы этого блока не было, phpDocumentor был бы недоволен. | |
* Здесь могла быть упомянута лицензия MIT. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Этот пример демонстрирует понятие "цепочки исключений" | |
// Показывает сохранение стэка вызовов (stack trace) при оборачивании исключений | |
function a() | |
{ | |
try { | |
b(); |