Skip to content

Instantly share code, notes, and snippets.

View papricek's full-sized avatar

Patrik Jíra papricek

  • Prague
View GitHub Profile
<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>
papricek / autoexec.cfg
Last active October 25, 2019 07:37
Counter Strike Global Offensive Config
// 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"
papricek / variables.yml
Created April 24, 2018 09:19
Variables to be edited by analytic power
:cg_name: ID7
:cg_type: text
:cg_description: Obchodní název
:label_cs: Obchodní název
papricek / Gemfile
Created September 30, 2013 16:11
How to setup an easy test suite.
# ./Gemfile
group :test do
gem "shoulda-context"
gem "shoulda-matchers"
gem "factory_girl_rails"
gem "mocha"
gem "ffaker"
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)
# 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 =<a.+?href=("|')([^"']+).*?>(.+?)<\/a>/, "\\2: \\3")
attachments = message.attachments
papricek / gist:3418963
Created August 21, 2012 20:08
Sample .gitignore file for kinda typical rails app
# 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...
papricek / gist:1704844
Created January 30, 2012 14:59
What a syntax sugar!
def in_action?(actions)
actions = [actions] if actions.is_a?(String)[:action])
<a href="" style="text-align:center;" title="Další libovolnej text">
<img src="" alt="Popisek loga takže asi něco jako RájŘ"><br />
Text si doplň dle libosti Ládí
papricek / gist:1518887
Created December 25, 2011 08:33
Render tree within a single sql query
def render_tree(nodes = [])
stack = []
html = ""
nodes.each do |node|
if stack.empty?
html << start_tag(node)
if stack.last.lft < node.lft && node.lft < stack.last.rgt