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 new_watir_browser | |
| set_headless if config.headless | |
| ..... | |
| end | |
| def set_headless | |
| begin | |
| require 'headless' | |
| @headless = Headless.new | |
| @headless.start |
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
| namespace :db do | |
| desc "load data from csv" | |
| task :load_csv_data => :environment do | |
| require 'fastercsv' | |
| FasterCSV.foreach("importdata/tarife.csv", :headers => true, :col_sep => ',') do |row| | |
| Anbieter.find_or_create_by_name( | |
| :name => row['Anbieter_Name'] | |
| :hotline => row['Hotline'], | |
| :email => row['Email'] |
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
| require 'active_support' | |
| DEPLOY_CONFIG = YAML::load(File.open("config/deploy.yml")) | |
| default_run_options[:pty] = true | |
| # | |
| # General Deployment settings | |
| # | |
| set :application, DEPLOY_CONFIG['application'] | |
| set :repository, DEPLOY_CONFIG['repository'] || 'master' | |
| set :scm, :git |
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
| <skm> what happens if you have more data then you do ram | |
| <ronr_> your machine explodes! | |
| <ronr_> you can use it for remote sabotage that way. |
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
| user app; | |
| worker_processes 2; | |
| error_log /home/app/logs/nginx.error.log info; | |
| events { | |
| worker_connections 1024; | |
| } | |
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
| Passenger `rails server` | |
| \ / | |
| \ / | |
| \ / | |
| \ / | |
| \ / | |
| \ / | |
| | | |
| MAGIC HAPPENS HERE | |
| | |
A template engine in 42 lines of code.
I was thinking of a way to generate HTML without using strings as embedding strings in Javascript is a pain if they are multi-lined. There isn't a nice triple quote like there exists in Python.
So I took my inspiration from Lisp HTML generators that use S-expressions to generate HTML. I thought, hell, S-expressions are just a bunch of nested lists, I could do the same thing in Javascript.
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
| namespace :assets do | |
| task :precompile, :roles => :web, :except => { :no_release => true } do | |
| if capture("diff -r #{latest_release}/app/assets/ #{current_release}/app/assets/ | wc -l").to_i > 0 | |
| run %Q{cd #{current_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
| else | |
| logger.info "Skipping asset pre-compilation because there were no asset changes" | |
| end | |
| end | |
| end |
- GoogleChrome
- MacBook
- MacOS
- tachpad
- size
- retina screen
- battery uptime
- провод питания с магнитом
OlderNewer