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
# unicorn_rails -c config/unicorn.rb -E production -D | |
working_directory File.join(File.dirname(File.expand_path(__FILE__)), '..') | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 4 : 1) | |
stderr_path "log/unicorn.stderr.log" |
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
Bluepill.application("app", :base_dir => "#{RAILS_ROOT}/tmp/bluepill", :log_file => "#{RAILS_ROOT}/log/bluepill.log") do |app| | |
app.process("unicorn") do |process| | |
process.pid_file = File.join(RAILS_ROOT, 'tmp/pids/unicorn.pid') | |
process.working_dir = RAILS_ROOT | |
process.start_command = "unicorn -c config/unicorn.rb -E production config.ru" | |
process.stop_command = "kill -QUIT {{PID}}" | |
process.restart_command = "kill -USR2 {{PID}}" | |
process.uid = process.gid = 'www' |
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
$('input:text').each(function() | |
{ | |
var $this = $(this); | |
var id = $this.attr('id'); | |
$this.replaceWith($('<textarea></textarea>').val($this.val()).attr('id', id); | |
}); | |
$('textarea').wysisyg(); |
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
(function($) | |
{ | |
$('.timepick').timeslider(); | |
})(jQuery); |
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
var body = []; | |
var body_length = 0; | |
sourceResponse.on('data', function(chunk) | |
{ | |
body.push(chunk); | |
body_length += chunk.length; | |
}); | |
sourceResponse.on('end', function() | |
{ |
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
class PropertyHash < Hash | |
def method_missing(name, *args, &block) | |
return self[name.to_s] if include?(name.to_s) && args.size == 0 | |
return !!self[$1] if name.to_s =~ /^(.+)\?$/ && include?($1) && args.size == 0 | |
if name.to_s =~ /^(.+)\=$/ && include?($1) && args.size == 1 | |
self[$1] = args.first | |
return | |
end | |
super | |
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
[34m7ccc3b4[m [32m[5 days ago][m (Mike Burns) Fix resizing bug with the editor WYSIWYG | |
diff --git a/public/javascripts/jquery.wysiwyg.js b/public/javascripts/jquery.wysiwyg.js | |
index 37ae000..961398b 100644 | |
--- a/public/javascripts/jquery.wysiwyg.js | |
+++ b/public/javascripts/jquery.wysiwyg.js | |
@@ -1327,26 +1327,6 @@ | |
.mousedown(function () { self.autoSaveFunction(); }) | |
.bind($.support.noCloneEvent ? "input.wysiwyg" : "paste.wysiwyg", function () { self.autoSaveFunction(); }); | |
} |
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
package FrontOffice::Controller::WizardSample; | |
=encoding windows-1251 | |
=head1 NAME | |
FrontOffice::Controller::WizardSample | |
=cut |
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
package AkzhanAbdulinFindIndex; | |
use warnings; | |
use strict; | |
use List::BinarySearch qw( binsearch_pos ); | |
sub new { | |
my ( $class ) = @_; |
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
# habraproxy.py — это простейший http-прокси-сервер, запускаемый локально (порт на ваше | |
# усмотрение), который показывает содержимое страниц Хабра. С одним исключением: после | |
# каждого слова из шести букв должен стоять значок «™». Примерно так: | |
# | |
# http://habrahabr.ru/company/yandex/blog/258673/ | |
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
# Сейчас на фоне уязвимости Logjam все в индустрии в очередной раз обсуждают проблемы и | |
# особенности TLS. Я хочу воспользоваться этой возможностью, чтобы поговорить об одной из | |
# них, а именно — о настройке ciphersiutes. | |
# |