Skip to content

Instantly share code, notes, and snippets.

View UserAd's full-sized avatar

Konstantin Tumalevich UserAd

  • Almaty, Kazakhstan
View GitHub Profile
# newgit.rb
# from Joao Vitor
# Creates a new rails application using git
# Initializes the git based on the sake task published on
# http://gist.github.com/6750
# task 'git:rails:new_app', :needs => [ 'rails:rm_tmp_dirs', 'git:hold_empty_dirs' ]
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
# newgit.rb
# from Joao Vitor
# Creates a new rails application using git
# Initializes the git based on the sake task published on
# http://gist.github.com/6750
# task 'git:rails:new_app', :needs => [ 'rails:rm_tmp_dirs', 'git:hold_empty_dirs' ]
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
# newgit.rb
# from Joao Vitor
# Creates a new rails application using git
# Initializes the git based on the sake task published on
# http://gist.github.com/6750
# task 'git:rails:new_app', :needs => [ 'rails:rm_tmp_dirs', 'git:hold_empty_dirs' ]
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
require 'rubygems'
require 'RMagick'
include Magick
WIDTH = 50
HEIGHT = 26
STEP = 32
image = Image.read("background.png")
data = image[0]
namespace :sphinx do
desc 'make symlinks'
task :symlink do
run <<-CMD
if [ ! -d #{shared_path}/sphinx ]; then mkdir -p #{shared_path}/sphinx; fi;
rm -fr #{release_path}/db/sphinx &&
ln -nfs #{shared_path}/sphinx #{release_path}/db/sphinx
CMD
end
1. Налог должен вычислятся автоматически в зависимости от того, какого типа транзакция
2. Должна быть система подтранзакций.
3. Создание подтранзакций полностью автоматическое и срабатывает во время сохранения транзакции (after_create)
4. Guardian(Защита переключения состояния) работает только у основной транзакции и проверяет сумму у всех транзакций, чтоб небыло проблем с различными состояниями транзакций
5. Для любой транзакции верхнего уровня есть метод подсчета всей суммы с налогами и без налогов.
6. Реферральские определяются из источника (пользователя от которого уходит платеж) и приемника (пользователя которому уходит платеж)
7. В каждой транзакции на момент ее подготовки (забора средств со счета) запоминается баланс всех сторон (нужно для поиска багов)
а) Типы транзакций:
1. Перевод денег системой MONEY_TACTION
// Custom transition for Scriptaculous
Effect.Transitions.easeInBack = function(pos) {
var x = 1.618;
return Math.pow(pos, 2) * ((x + 1) * pos - x);
};
var WebcallPlugin = {
actionInProcess : false,
validateResult : false,
<script>
document.observe('dom:loaded', function() {
WebcallPlugin.initialize({
actionButton : $$('#webcall-wrapper a.form-submit')[0],
frameContainer : $$('#webcall-wrapper ul')[0],
frameWidth : $$('#webcall-wrapper ul li')[0].getWidth(),
haveMoney : <%=@current_user.webcall_allowed?%>,
captions : {
phone : 'phone number',
sip : 'SIP Address',
// Custom transition for Scriptaculous
Effect.Transitions.easeInBack = function(pos) {
var x = 1.618;
return Math.pow(pos, 2) * ((x + 1) * pos - x);
};
var WebcallPlugin = {
actionInProcess : false,
validateResult : false,
interval : null,
// Custom transition for Scriptaculous
Effect.Transitions.easeInBack = function(pos) {
var x = 1.618;
return Math.pow(pos, 2) * ((x + 1) * pos - x);
};
var WebcallPlugin = {
actionInProcess : false,
validateResult : false,
interval : null,