Skip to content

Instantly share code, notes, and snippets.

[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>
- if flash.present?
%ul#flash
- flash.each do |key, value|
%li(class=key)= value
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 )
<?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);
}
@exviva
exviva / gist:5696879
Created June 3, 2013 08:34
js.pusher.com
$ 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
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
@exviva
exviva / Shameless
Last active January 25, 2017 02:04
Shameless usage
Shameless usage
@exviva
exviva / Gemfile
Created January 25, 2017 02:07
Shameless Gemfile
gem ‘shameless’
@exviva
exviva / rate_store.rb
Created January 25, 2017 02:08
Shameless initializer
# 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
@exviva
exviva / rate.rb
Created January 25, 2017 02:10
Shameless model
# app/models/rate.rb
class Rate
RateStore.attach(self)
index do
integer :hotel_id
string :room_type
string :check_in_date