View gist:c35d575113fb7a61a19f71df6c13878e
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
<div class="clearfix text-right" style="width: 100%"> | |
<a href="#" class="text-blue btn">Přihlášení</a> | |
<a href="#" class="text-blue btn">Registrace</a> | |
</div> |
View autoexec.cfg
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
// budi's CS:GO config | |
// Updated 7/1/2019 | |
// Rates | |
rate "786432" // max rate, lower if having network issues | |
cl_cmdrate "128" | |
cl_updaterate "128" | |
cl_interp "0.0" | |
cl_interp_ratio "1" | |
cl_interpolate "1" |
View variables.yml
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
--- | |
:line_fields: | |
:general: | |
:lines: | |
obchodni_nazev_ID7: | |
:cg_name: ID7 | |
:cg_type: text | |
:cg_test_data: HEINEKEN SLOVENSKO | |
:cg_description: Obchodní název | |
:label_cs: Obchodní název |
View Gemfile
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
# ./Gemfile | |
... | |
group :test do | |
gem "shoulda-context" | |
gem "shoulda-matchers" | |
gem "factory_girl_rails" | |
gem "mocha" | |
gem "ffaker" |
View anonymous_user.rb
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
class AnonymousUser < User | |
attr_accessible *ACCESSIBLE_ATTRS, :type, :token, as: :registrant | |
def register(params) | |
params = params.merge(type: 'User', token: nil) | |
self.update_attributes(params, as: :registrant) | |
end | |
end |
View text_mail_interceptor.rb
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
# You just put this in config/initializers. Dont create text.erb files! ;) | |
# Text parts are auto-generated from html.erb templates. | |
include ActionView::Helpers::SanitizeHelper | |
class TextMailInterceptor | |
def self.delivering_email(message) | |
html = message.html_part.try(:body).try(:to_s) || message.body.to_s | |
text = HTMLEntities.new.decode(html).gsub(/<a.+?href=("|')([^"']+).*?>(.+?)<\/a>/, "\\2: \\3") | |
attachments = message.attachments |
View gist:3418963
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
# What are .gitignore files for? Well, not everything should be stored in a repo. | |
# Typically your IDE files, log files, or database related stuff (like paperclip attachments in public/system) | |
.DS_Store # because Mac file system | |
/.rvmrc # when you have .rvmrc file with default rails and gemset | |
/.idea # RubyMine project stuff | |
/.bundle # Bundler temp stuff | |
/db/*.sqlite3 # DB file, when using sqlite | |
/config/database.yml # db config - this is probably the only line here, that not including is both bad practice and dangerous | |
/log/*.log # wanna store gigabytes of logs in repo? c'mon... |
View gist:1704844
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
def in_action?(actions) | |
actions = [actions] if actions.is_a?(String) | |
actions.map(&:to_s).include?(params[:action]) | |
end |
View gist:1649154
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 href="http://www.rajremesel.cz" style="text-align:center;" title="Další libovolnej text"> | |
<img src="http://www.rajremesel.cz/media/logosmall-transparent.png" alt="Popisek loga takže asi něco jako RájŘemesel.cz"><br /> | |
Text si doplň dle libosti Ládí | |
</a> |
View gist:1518887
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
def render_tree(nodes = []) | |
stack = [] | |
html = "" | |
nodes.each do |node| | |
if stack.empty? | |
html << start_tag(node) | |
stack.push(node) | |
next | |
end | |
if stack.last.lft < node.lft && node.lft < stack.last.rgt |