Skip to content

Instantly share code, notes, and snippets.

View timurvafin's full-sized avatar

Timur Vafin timurvafin

View GitHub Profile
require File.dirname(__FILE__) + '/../spec_helper'
describe ApplicationHelper do
include ApplicationHelper
it 'helper setup instance variable' do
helper.setup_instance_var('test')
assigns['test_value'].should == 'test'
end
end
#!/usr/bin/env ruby
require 'rubygems'
gem 'mechanize', '>= 0.8.5'
require 'mechanize'
if ARGV[0].nil? || ARGV[1].nil? || ARGV[2].nil?
raise ArgumentError
end
#!/usr/bin/env ruby
=begin
INSTALL:
curl http://github.com/defunkt/gist/raw/master/gist.rb > gist &&
chmod 755 gist &&
sudo mv gist /usr/local/bin/gist
class ActiveRecord::Base
def dup
returning super do |obj|
obj.instance_variable_set('@attributes', instance_variable_get('@attributes').dup)
end
end
end
class FacebookPublisher < Facebooker::Rails::Publisher
include Kt::Rails::KontagentHelpers
def kt_notification(event_name, from_user, recipient_ids, link_url)
send_as :notification
recipients recipient_ids
from Facebooker::User.new(from_user.user_id)
campaign event_name
require 'rubygems'
require 'activesupport'
class Hash
class Path
def initialize(hash)
@hash = hash
end
def [](path)
## update_iptables
dir=`dirname $0`
dir=`readlink -f $dir`
update_iptables_config() {
mv -f /etc/sysconfig/iptables /etc/sysconfig/iptables.`date +%F`
ip=`/sbin/ifconfig $1 | sed -n "/^[A-Za-z0-9]/ {N;/dr:/{;s/.*dr://;s/ .*//;p;}}"`
cat $dir/iptables.base | sed "s/EXTERNAL_DEV/$1/" | sed "s/EXTERNAL_IP/$ip/" > /etc/sysconfig/iptables
cat /etc/sysconfig/iptables | /sbin/iptables-restore
#!/bin/env ruby
# Usage: ruby wifi.rb wifi.kml.xml > free_wifi.kml.xml
require 'rubygems'
require 'pp'
require 'nokogiri'
xml_doc = Nokogiri::XML(File.open(ARGV.first))
module ApplicationHelper
def my_helper(message)
with_output_buffer { yield(message) }
end
end
<%= my_helper('test') do |value| %>
<%= value %>
<% end %>

Тезисы:

  • В телефоне надо быстро именно быстро записывать расходы, иначе это будет неудобно и расходы записываться не будут

  • В телефоне надо смотреть месячный бюджет, чтобы понимать можно ли тратить в данный момент на что то деньги или нет

  • Составлять бюджет, сверять счета с выписками из банков нужно на десктопе

  • Мобильный клиент должен синхронизироваться с десктопной версией

  • Данные с десктопной версии должны бекапиться - отдельная задача, не должна решаться системой учета финансов

  • Web interface для мобильного клиента не подходит, так работа в инете медленная

  • Web interface для десктоп версии не подходит, так как плохо расшаривать свои расходы и бюджеты