Skip to content

Instantly share code, notes, and snippets.

View psylone's full-sized avatar
💭
Be kind; everyone you meet is fighting a hard battle

Evgeniy Fateev psylone

💭
Be kind; everyone you meet is fighting a hard battle
View GitHub Profile
@psylone
psylone / indicator.rb
Created July 12, 2014 05:58
Indicator class for control player parameters (experience, energy, attack etc.)
class Indicator < ActiveRecord::Base
include CorruptionResponder
include CorruptionIncrement
include CorruptionDecrement
include PartnerShip
include GiveUnit
PARAM_NAMES = %w{attack defence health energy clashes}
@psylone
psylone / ip_tracker.rb
Created July 12, 2014 05:53
Control players with the same IP
module IPTracker
class IP
include Comparable
# Количество секунд, после которого игроки
# с одинаковым IP считаются разными
TIMESTAMP_LIMIT = 86400
# code_1
class Point
end
# puts Point.new
# code_1.1
@psylone
psylone / modules.coffee
Last active August 29, 2015 13:58 — forked from anonymous/jsbin.gavivewi.coffee
Thoughts about modules
class MyModule
@EXTENSION = [
'one',
'two'
]
@one: ->
do @hello
require 'google/api_client' # version 0.7.1
# Set purchase data hash
data = {
token: 'gldfdkfjpnnhmnclekpndgph.AO-J1OwXKIzAKUzprnFnNTClSoe7AYx4kF6_d5IujRI7jiTUIHMwQq0oV_fXyjMXf3sUzpCaS0lUWXvqpraR5Pp5Fmk4MvN7CbGDU0lgAg_kqvKDgT1A9y6C3mpBjYBLPN64plT78M-V',
productId: 'chebucks18',
packageName: 'com.snegoffon.corruption'
}
# Initialize client
module App
class Root
def call env
[ 200, { 'Content-Type' => 'text/html' }, ["root page"] ]
end
end
class Info
@psylone
psylone / rspec_unit_template.rb
Last active December 25, 2015 15:19
RSpec Unit test template.
# RSpec Unit Template
describe Model do
# Factories
describe "has facttories" do
it "model factory" do
end
it "another model factory" do