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
#verifications/index.haml | |
- unless @ads.unverified_ads.empty? | |
= link_to "Szybka Weryfikacja", fast_verify_info_verification_path(@ads.unverified_ads.last), :method => :put | |
= link_to "Ogłoszenia do zweryfikowania", verifications_path(:scope => "unverified_ads") | |
= @ads.unverified_ads.count | |
= link_to "Normal Verify", verify_info_verification_path(ad), :method => :put | |
#verifications/verify_info.haml | |
= link_to "Verify", verify_verification_path(@ad) | |
#verifications/fast_verify_info.haml |
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
# muzang_instance.rb | |
require 'muzang' | |
require 'muzang-plugins' | |
class SendMessageToChannel | |
include Muzang::Plugins::Helpers | |
def initialize(bot) | |
@bot = bot | |
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
- unless @unconfirmed_ads.empty? # którą wersję wybrać? | |
- unless Ad.unconfirmed_empty? # metoda w modelu - Tak miałem do tej pory, wg wskazówek :) | |
= link_to "Szybka Weryfikacja", verification_path(@last_unverified_ad), :method => :put | |
= link_to "Ogłoszenia do zweryfikowania", verifications_path(:scope => "unverified_ads") | |
[ | |
= @unverified_count # tak wydaje się nienajlepszą opcją | |
] | |
= link_to "Ogłoszenia potwierdzone", verifications_path(:scope => "confirmed_ads") | |
[ |
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
Show | |
You can show the structure of the groups and their Guards with the show task: | |
$ guard show | |
(global): | |
shell | |
Group backend: | |
bundler |
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
# encoding: utf-8 | |
class FileUploader < CarrierWave::Uploader::Base | |
include CarrierWave::RMagick | |
storage :file | |
def store_dir | |
"photos/#{model.attachable_id}" | |
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
CREATE TABLE users ( | |
id INTEGER PRIMARY KEY, | |
user_login text NOT NULL DEFAULT '', | |
user_pass text NOT NULL DEFAULT '', | |
user_nicename text NOT NULL DEFAULT '', | |
user_email text NOT NULL DEFAULT '', | |
user_url text NOT NULL DEFAULT '', | |
user_registered datetime NOT NULL DEFAULT '0000-00-00 00:00:00', | |
user_activation_key text NOT NULL DEFAULT '', | |
user_status integer NOT NULL DEFAULT '0', |
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
%w[rubygems digest/md5 sinatra haml sass warden rack/flash ./db/database].each{ |gem| require gem } | |
require "sinatra/reloader" if development? | |
set :root, File.dirname(__FILE__) | |
set :views, "views" | |
get '/main.css' do | |
header 'Content-Type' => 'text/css; charset=utf-8' | |
sass :main |
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
%w[rubygems digest/md5 sinatra sinatra/reloader haml sass warden rack/flash sinatra/activerecord].each{ |gem| require gem } | |
set :root, File.dirname(__FILE__) | |
set :views, "views" | |
get '/main.css' do | |
header 'Content-Type' => 'text/css; charset=utf-8' | |
sass :main | |
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
Aplikacja(w sinatrze pisana) powinna: | |
- pozwolić użytkownikowi wypozyczyć przedmiot na dany okres czasu | |
- zabronić wypożyczyć jeżeli dany przedmiot jest w tym okresie czasu wypożyczony | |
- sprawdzać w magazynie czy jest jeszcze jakiś przedmiot dostępny i wypożyczyć ostatni niewypozyczony | |
Przykład: | |
Magazyn: 2 namioty, 3 pary raków | |
Użytkownik wypożycza namiot na dany okres czasu(na początek ustalmy że wpisuje ręcznie np. "na tydzien") |
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
source 'http://rubygems.org' | |
gem 'sinatra' | |
gem 'haml' | |
gem 'sass' | |
gem 'warden' | |
gem 'sinatra-activerecord' | |
gem 'rack', '1.3.6' | |
gem 'rack-flash' | |
group :development do | |
gem 'guard-livereload' |
OlderNewer