Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View akzhan's full-sized avatar

Akzhan Abdulin akzhan

View GitHub Profile
package AkzhanAbdulinFindIndex;
use warnings;
use strict;
use List::BinarySearch qw( binsearch_pos );
sub new {
my ( $class ) = @_;
@akzhan
akzhan / WizardSample.pm
Created October 29, 2012 07:03
пример визарда
package FrontOffice::Controller::WizardSample;
=encoding windows-1251
=head1 NAME
FrontOffice::Controller::WizardSample
=cut
7ccc3b4 [5 days ago] (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(); });
}
@akzhan
akzhan / access.theme.rb
Created October 19, 2010 09:21
How to use hash as getters and setters
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
var body = [];
var body_length = 0;
sourceResponse.on('data', function(chunk)
{
body.push(chunk);
body_length += chunk.length;
});
sourceResponse.on('end', function()
{
(function($)
{
$('.timepick').timeslider();
})(jQuery);
$('input:text').each(function()
{
var $this = $(this);
var id = $this.attr('id');
$this.replaceWith($('<textarea></textarea>').val($this.val()).attr('id', id);
});
$('textarea').wysisyg();
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'
# 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"
--- lib/chef/rest.rb 2010-05-19 14:25:18.000000000 +0400
+++ lib/chef/rest.rb 2010-05-19 14:26:57.000000000 +0400
@@ -178,23 +178,20 @@
end
http.read_timeout = Chef::Config[:rest_timeout]
+ json_body = data ? data.to_json : nil
headers = @default_headers.merge(headers)
-