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
| for f in `find . -regex '.*\.html\.erb'`; do echo "Converting $f" && html2haml $f > "${f%.erb}.haml" && rm $f; done |
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
| desc "Dump remote production postgresql database, rsync to localhost" | |
| task :postgresql do | |
| get("#{current_path}/config/database.yml", "tmp/database.yml") | |
| remote_settings = YAML::load_file("tmp/database.yml")[rails_env] | |
| local_settings = YAML::load_file("config/database.yml")["development"] | |
| run "export PGPASSWORD=#{remote_settings["password"]} && pg_dump --host=#{remote_settings["host"]} --port=#{remote_settings["port"]} --username #{remote_settings["username"]} --file #{current_path}/tmp/#{remote_settings["database"]}_dump -Fc #{remote_settings["database"]}" | |
| run_locally "rsync --recursive --times --rsh=ssh --compress --human-readable --progress #{user}@#{shared_host}:#{current_path}/tmp/#{remote_settings["database"]}_dump tmp/" |
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
| @map_function = " | |
| function(log) { | |
| var pad = function(n) {return n<10 ? '0'+n : n} | |
| var date = new Date(log.created_at); | |
| var d = pad(date.getFullYear()) + '-' + pad(date.getMonth()+1) + '-' + pad(date.getDate()); | |
| return { group_period: d }; | |
| }" | |
| @reduce_function = " function(doc, out) { out.count++; } " |
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
| <div style="text-align: center"> | |
| <script type="text/javascript" src="http://www.kaltura.com/p/874892/sp/87489200/embedIframeJs/uiconf_id/7218852/partner_id/874892"></script><object id="kaltura_player_1335237510" name="kaltura_player_1335237510" type="application/x-shockwave-flash" allowfullscreen="true" allownetworking="all" allowscriptaccess="always" height="450" width="500" bgcolor="#000000" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://www.kaltura.com/index.php/kwidget/cache_st/1335237510/wid/_874892/uiconf_id/7218852/entry_id/1_qjhijm22" data="http://www.kaltura.com/index.php/kwidget/cache_st/1335237510/wid/_874892/uiconf_id/7218852/entry_id/1_qjhijm22"><param name="allowFullScreen" value="true"><param name="allowNetworking" value="all"><param name="allowScriptAccess" value="always"><param name="bgcolor" value="#000000"><param name="flashVars" value="&{FLAVOR}"><param name="movie" value="http://www.kaltura.com/index.ph |
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
| <div style="text-align: center"> | |
| <script type="text/javascript" src="http://www.kaltura.com/p/874892/sp/87489200/embedIframeJs/uiconf_id/7218852/partner_id/874892"></script><object id="kaltura_player_1337705630" name="kaltura_player_1337705630" type="application/x-shockwave-flash" allowfullscreen="true" allownetworking="all" allowscriptaccess="always" height="450" width="500" bgcolor="#000000" xmlns:dc="http://purl.org/dc/terms/" xmlns:media="http://search.yahoo.com/searchmonkey/media/" rel="media:video" resource="http://www.kaltura.com/index.php/kwidget/cache_st/1337705630/wid/_874892/uiconf_id/7218852/entry_id/1_ftzarkdi" data="http://www.kaltura.com/index.php/kwidget/cache_st/1337705630/wid/_874892/uiconf_id/7218852/entry_id/1_ftzarkdi"><param name="allowFullScreen" value="true"><param name="allowNetworking" value="all"><param name="allowScriptAccess" value="always"><param name="bgcolor" value="#000000"><param name="flashVars" value="&{FLAVOR}"><param name="movie" value="http://www.kaltura.com/index.ph |
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
| # encoding: utf-8 | |
| class AvatarUploader < CarrierWave::Uploader::Base | |
| include CarrierWave::MiniMagick | |
| # Choose what kind of storage to use for this uploader: | |
| storage :file | |
| # Override the directory where uploaded files will be stored. |
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 'benchmark' | |
| n = 1000 | |
| Benchmark.bm do |x| | |
| x.report { | |
| n.times do |j| | |
| Item.all(:conditions => {:id => with}, :order => "FIELD(id, #{with.join(',')})") | |
| end | |
| } | |
| 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
| require 'benchmark' | |
| require "pony-express" | |
| require 'net/smtp' | |
| BOUNDARY = Time.now.to_i.to_s | |
| headers =<<EOF | |
| From: xxx@gmail.com | |
| Subject: Hello Mr.Burns | |
| To: xxx2@gmail.com |
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
| --- | |
| rackup: /xapit.ru | |
| chdir: /app | |
| environment: production | |
| address: 0.0.0.0 | |
| port: 9293 | |
| timeout: 30 | |
| log: log/thin.log | |
| pid: tmp/pids/thin.pid | |
| max_conns: 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
| for f in *.scss; do sass-convert -F scss -T sass $f ${f%%.*}.sass; done |
OlderNewer