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
# frozen_string_literal: true | |
ruby File.read(File.join(__dir__, '.ruby-version')).strip | |
source 'https://rubygems.org' | |
gem 'activesupport', '~>5.2.6' | |
gem "benchmark-memory" |
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 Hash | |
def collect!(&block) | |
ret = [] | |
self.each {|key,val| | |
if val.kind_of? Array | |
val.collect!{|subval| | |
block.call subval | |
} | |
ret = val | |
end |
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 Hash | |
def deep_merge(other_hash, &block) | |
dup.deep_merge!(other_hash, &block) | |
end | |
def deep_merge!(other_hash, &block) | |
other_hash.each_pair do |k,v| | |
tv = self[k] | |
if tv.is_a?(Hash) && v.is_a?(Hash) | |
self[k] = tv.deep_merge(v, &block) |
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
<!-- in footer.php --> | |
<?php if ($u->data->ID > 0): ?> | |
<script type="text/javascript"> | |
var _cmq = _cmq || []; | |
_cmq.push(['identify', [<?=$u->data->ID?>, {email: "<?=$u->data->user_email;?>"}]]); | |
</script> | |
<?php endif; ?> | |
<script type="text/javascript"> | |
var _cmq = _cmq || []; | |
var _cmk = _cmk || '0162cb4658a377810a1ad4979272a79e' //your token; |
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
Eye.load("./*.rb") | |
SERVER_WORK_DIR = File.expand_path(File.join(File.dirname(__FILE__), '../../')) | |
# Eye self-configuration section | |
Eye.config do | |
logger File.join(SERVER_WORK_DIR, 'log/eye.log') | |
end | |
# Adding application | |
Eye.application "statsio_client_alpha" do |
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
var ValidateLocation = function() | |
{ | |
this.execute = function(world, rooms, logger) | |
{ | |
var checkAttributes = function(object, attributes) { | |
if (object == undefined ) | |
return false; | |
for (var key in attributes) { | |
if (object.hasOwnProperty(attributes[key])) { |
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
hash = {"player" => {"food" =>90, "options" => {"location" => {"map_social_id" => 1}}, "exp" => 100}} | |
available_fileds = { | |
"player" => {"food" => 1, "exp" => 1} | |
} | |
class Hash | |
def intersection(another_hash) | |
keys_intersection = self.keys & another_hash.keys | |
merged = self.dup.update(another_hash) |
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
//Migration remove_clean_obst_large_tree | |
var _20130809164731 = function() | |
{ | |
this.name = "remove_clean_obst_large_tree"; //имя указанное при создании миграции | |
this.version = 20130809164731; //время создания миграции | |
this.script_version = "dev_1376050014278"; //версия скриптинга | |
this.execute = function(world, rooms, context, config) | |
{ | |
var removed_quest_name = 'clean_obst_large_tree'; |