This file contains 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
// Comment test | |
var ndviFunc = function({ h, s, v }, [_r, _g, _b, _a]) { | |
if (_r === 0 && _g === 0 && _b === 0) { | |
_a = 0; | |
} | |
let r, g, b, i, f, p, q, t; | |
i = Math.floor(h * 6); |
This file contains 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 CreateTimeInStates < ActiveRecord::Migration[5.0] | |
def up | |
execute <<-SQL | |
CREATE TYPE state_trackable_models AS ENUM ('AutoProcess', 'Partner'); | |
SQL | |
create_table :time_in_states do |t| | |
t.integer :state, null: false | |
t.column :state_trackable_id, :integer, null: false |
This file contains 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
<members> | |
<member> | |
<username>brettb</username> | |
<screen_name>Brett Bretterson</screen_name> | |
</member> | |
<member> | |
<username>robr</username> | |
<screen_name>Robert Robertson</screen_name> | |
</member> | |
</members> |
This file contains 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
# Arel | |
#"ROW_NUMBER() OVER ()" | |
row_nubmer = Arel::Nodes::NamedFunction.new('ROW_NUMBER', [] ) | |
sql = Arel::Nodes::Over.new(row_number).as('row_number') | |
row_nubmer.over.as('row_number') | |
table = Arel::Table.new :users | |
# COUNT("users"."id") OVER () AS foo | |
table[:id].count.over.as('foo') |
This file contains 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
-- View Current Lock | |
SELECT c.relname, l.mode, l.granted, l.pid FROM pg_locks as l JOIN pg_class as c on c.oid = l.relation; | |
-- UTF-8 text search by index | |
create index on <table> (<column> text_pattern_ops); | |
-- Generate nodes path | |
create table <table> as select i, format('/%s/%s/', (random() * 10), (random() * 10)) from generate_series(1,100000); | |
-- Create extension |
This file contains 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
total_run_times 0 | |
background yes | |
cpu_avg_samples 1 | |
net_avg_samples 2 | |
double_buffer yes | |
no_buffers no | |
text_buffer_size 2048 |
This file contains 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
passenger_set_cgi_param HTTP_X_ACCEL_MAPPING /local/storage/=/storage/; | |
location /storage/ { | |
internal; | |
alias /local/storage/; | |
} | |
# From 'lib/rack/sendfile' | |
location ~ /storage/(.*) { | |
internal; | |
alias /local/storage/$1; |
This file contains 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
.icon-accept { | |
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKfSURBVDjLpZPrS1NhHMf9O3bOdmwDCWREIYKEUHsVJBI7mg3FvCxL09290jZj2EyLMnJexkgpLbPUanNOberU5taUMnHZUULMvelCtWF0sW/n7MVMEiN64AsPD8/n83uucQDi/id/DBT4Dolypw/qsz0pTMbj/WHpiDgsdSUyUmeiPt2+V7SrIM+bSss8ySGdR4abQQv6lrui6VxsRonrGCS9VEjSQ9E7CtiqdOZ4UuTqnBHO1X7YXl6Daa4yGq7vWO1D40wVDtj4kWQbn94myPGkCDPdSesczE2sCZShwl8CzcwZ6NiUs6n2nYX99T1cnKqA2EKui6+TwphA5k4yqMayopU5mANV3lNQTBdCMVUA9VQh3GuDMHiVcLCS3J4jSLhCGmKCjBEx0xlshjXYhApfMZRP5CyYD+UkG08+xt+4wLVQZA1tzxthm2tEfD3JxARH7QkbD1ZuozaggdZbxK5kAIsf5qGaKMTY2lAU/rH5HW3PLsEwUYy+YCcERmIjJpDcpzb6l7th9KtQ69fi09ePUej9l7cx2DJbD7UrG3r3afQHOyCo+V3QQzE35pvQvnAZukk5zL5qRL59jsKbPzdheXoBZc4saFhBS6AO7V4zqCpiawuptwQG+UAa7Ct3UT0hh9p9EnXT5Vh6t4C22QaUDh6HwnECOmcO7K+6kW49DKqS2DrEZCtfuI+9GrNHg4fMHVSO5kE7nAPVkAxKBxcOzsajpS4Yh4ohUPPWKTUh3PaQEptIOr6BiJjcZXCwktaAGfrRIpwblqOV3YKdhfXOIvBLeREWpnd8ynsaSJoyESFphwTtfjN6X1jRO2+FxWtCWksqBAp |
This file contains 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
# The MIT License (MIT) http://vakiliy.mit-license.org | |
# CallBack Module | |
module CallBackHelper | |
class TypeError < StandardError | |
def initialize(msg = 'Callback type error. Required: Symbol, String or Proc') | |
super msg | |
end | |
end | |
class UseError < StandardError |
This file contains 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
<xsl:if test="count(.//year) != 0"> | |
<div> | |
<xsl:for-each select=".//year[generate-id() = generate-id(key('years',.)[1])]"> | |
<xsl:if test="./text() = /.//selected_year "> | |
<xsl:attribute name="class">current</xsl:attribute> | |
</xsl:if> | |
<xsl:if test="position() = 1"></xsl:if><xsl:value-of select="." /> г. | |
</xsl:for-each> | |
</div> | |
</xsl:if> |
NewerOlder