This file contains hidden or 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
| # Hack to disable logging of asset pipeline | |
| # config/initializers/quiet_assets.rb | |
| Rails.application.assets.logger = Logger.new('/dev/null') | |
| Rails::Rack::Logger.class_eval do | |
| def call_with_quiet_assets(env) | |
| previous_level = Rails.logger.level | |
| Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 | |
| call_without_quiet_assets(env).tap do | |
| Rails.logger.level = previous_level | |
| end |
This file contains hidden or 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
| PROMPT="%{$fg[cyan]%}[%~% ]%b%{$reset_color%} " |
This file contains hidden or 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
| <!doctype html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title></title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width"> | |
| <link rel="stylesheet" href="css/style.css"> | |
| <script src="js/libs/modernizr-2.5.3.min.js"></script> |
This file contains hidden or 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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This file contains hidden or 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 | |
| gem 'annotate', :git => 'git://github.com/jeremyolliver/annotate_models.git', :branch => 'rake_compatibility' | |
| bundle exec annotate | |
| bundle exec annotate -r | |
| bundle exec annotate -d |
This file contains hidden or 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
| #rspec | |
| controller.stub!(:current_user).and_return(create(:user)) |
This file contains hidden or 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
| set :asset_env, "RAILS_GROUPS=assets" | |
| set :asset_directory, 'public/assets' | |
| set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb) | |
| after 'deploy:update_code', 'deploy:assets' | |
| namespace :deploy do | |
| task :assets, :roles => :web, :except => { :no_release => true } do | |
| from = source.next_revision(current_revision) | |
| if capture("cd #{latest_release} && #{source.local.log(from)} #{assets_dependencies.join ' '} | wc -l").to_i > 0 |
This file contains hidden or 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
| /** | |
| * Modal window | |
| */ | |
| (function($) { | |
| var defaults = { | |
| url: false, | |
| opener: false, | |
| remote: true, | |
| content: '', | |
| data: {}, |
This file contains hidden or 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
| # NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
| $ cd /usr/src | |
| $ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
| $ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
| $ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
| $ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
| $ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
This file contains hidden or 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 index | |
| q = params[:q] | |
| if q == "what is the sum of 8 and 22" | |
| rezult = "30" | |
| elsif q.include? "what is your name" | |
| rezult = "torbjon" | |
| elsif q.include? "I was here before. what is my name" | |
| rezult = Stuff.first.name | |
| elsif q.include? "want to shop. What products do you have for sale (comma separated)" | |
| rezult = "banana, apple" |
OlderNewer