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
[paperclip] identify '-format' '%wx%h' '/tmp/stream,4458,0.JPG[0]' 2>/dev/null | |
[paperclip] convert '"/tmp/stream,4458,0.JPG[0]" -resize "x100" -crop "100x100+16+0" +repage "/tmp/stream,4458,0,4458,0[0]"' 2>/dev/null | |
[paperclip] An error was received while processing: #<Paperclip::PaperclipError: There was an error processing the watermark for stream,4458,0> | |
[paperclip] identify '-format' '%wx%h' '/tmp/stream,4458,0.JPG[0]' 2>/dev/null | |
[paperclip] composite '-gravity Center /home/olek/projekty/shotmix/public/images/watermark.png "/tmp/stream,4458,0.JPG[0]" -resize "640x480>" "/tmp/stream,4458,0,4458,1[0]"' 2>/dev/null | |
[paperclip] An error was received while processing: #<Paperclip::PaperclipError: There was an error processing the watermark for stream,4458,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
- if flash.present? | |
%ul#flash | |
- flash.each do |key, value| | |
%li(class=key)= value |
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
Rakefile | |
-Rails::Application.load_tasks | |
+My::Application.load_tasks | |
config/application.rb | |
-Bundler.require :default, Rails.env | |
+Bundler.require(:default, Rails.env) if defined?(Bundler) | |
- # config.load_paths += %W( #{config.root}/extras ) |
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
<?php | |
class Admin_ContentTranslationsControllerTest extends Our_Test_ControllerTestCase | |
{ | |
function testEditFindTranslationByIdTheOldWay() | |
{ | |
$this->table->insert(array('key' => 'foo')); | |
$this->get('edit', array('id' => '1')); | |
$this->assertEquals(1, $this->assigns->translation->id); | |
} |
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
unless ENV.include?('CI') | |
ENV['DISPLAY'] = ':99' | |
pid = Process.spawn('Xvfb :99 -ac', out: '/dev/null', err: '/dev/null') | |
at_exit { Process.kill(:SIGINT, pid) } | |
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
$ dig js.pusher.com | |
; <<>> DiG 9.9.2-P1 <<>> js.pusher.com | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63691 | |
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 | |
;; OPT PSEUDOSECTION: | |
; EDNS: version: 0, flags:; udp: 4096 |
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
Shameless usage |
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
gem ‘shameless’ |
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
# config/initializers/rate_store.rb | |
RateStore = Shameless::Store.new(:rate_store) do |c| | |
c.partition_urls = [ | |
ENV['RATE_STORE_DATABASE_URL_0'], | |
ENV['RATE_STORE_DATABASE_URL_1'] | |
] | |
# total number of shards across all partitions | |
c.shards_count = 512 | |
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
# app/models/rate.rb | |
class Rate | |
RateStore.attach(self) | |
index do | |
integer :hotel_id | |
string :room_type | |
string :check_in_date |
OlderNewer