Skip to content

Instantly share code, notes, and snippets.

Timko Unkas82

Block or report user

Report or block Unkas82

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View aaa.rb
module Devise::Strategies
# Rастомная стратегия аутентификации
class Aaa < Authenticatable
def authenticate!
# binding.pry
resource = password.present? && mapping.to.find_for_database_otp_authentication(authentication_hash)
encrypted = false
if validate(resource){ encrypted = true; resource.valid_password?(password) && valid_otp?(resource) }
(resource)
View gist:951e61354c5dc85b1aff3a74cd8c60de
class ExternalPlaylistsFacade
include PlaylistHelper
include Concerns::VideoFormats
include Multisportable
GLUE_THRESHOLD = 2
attr_reader :matches_count, :type, :matches
def initialize(playlist:, current_user:, type:, current_ip:)
View seafile.rb
class Seafile < ActiveRecord::Base
belongs_to :user
has_one :message
has_and_belongs_to_many :allow_users, class_name: 'User'
before_save :check_constraints
def share(user)
allow_users << user
end
View gist:4ba1063f094641c7bdcaad29e574f3d7
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 4.1.15'
gem 'pg'
gem 'redis', '~> 3.2'
# Use only by admin path
gem 'underscore-rails'
gem 'geocoder', '~> 1.4.9'
View tr_playlist component
var MyPlaylistsActions = require('../../actions/my-playlists-actions');
var ShareActions = require('../../actions/share-actions');
var MyPlaylistsTrPlaylist = React.createClass({
getInitialState: function() {
return {
title: this.props.playlist.title,
subtitle: this.props.playlist.subtitle,
editTitle: false,
View gist:8ef799686b516edae83fa916db3dd6a3
ggg = [{"from"=>12.259, "to"=>18.259, "fname"=>"10041025_1", "title"=>"1st period, 0:07 - 0:13"}, {"from"=>34.168, "to"=>40.168, "fname"=>"10040915_1", "title"=>"1st period, 0:31 - 0:37"}, {"from"=>37.756, "to"=>43.756, "fname"=>"10040985_1", "title"=>"1st period, 0:32 - 0:38"}, {"from"=>133.917, "to"=>139.917, "fname"=>"10040902_1", "title"=>"1st period, 1:12 - 1:18"}, {"from"=>114.087, "to"=>120.087, "fname"=>"10040972_1", "title"=>"1st period, 1:20 - 1:26"}, {"from"=>89.142, "to"=>95.142, "fname"=>"10040997_1", "title"=>"1st period, 1:24 - 1:30"}, {"from"=>92.859, "to"=>98.859, "fname"=>"10040997_1", "title"=>"1st period, 1:27 - 1:33"}, {"from"=>164.701, "to"=>170.701, "fname"=>"10040997_1", "title"=>"1st period, 2:39 - 2:45"}, {"from"=>174.096, "to"=>180.096, "fname"=>"10040997_1", "title"=>"1st period, 2:48 - 2:54"}, {"from"=>256.95, "to"=>262.95, "fname"=>"10040972_1", "title"=>"1st period, 2:52 - 2:58"}, {"from"=>270.006, "to"=>276.006, "fname"=>"10040915_1", "title"=>"1st period, 3:08 - 3:14"}, {"from
View gist:7d4364bbedeb6d0a199c27dca8e41ceb
ggg = [{"from"=>124.596, "to"=>136.596, "fname"=>"20290688_1", "title"=>"1st quarter, 1:57 - 1:09"}, {"from"=>189.521, "to"=>201.521, "fname"=>"20293472_1", "title"=>"1st quarter, 2:00 - 2:12"}, {"from"=>177.952, "to"=>189.952, "fname"=>"20282215_1", "title"=>"1st quarter, 2:19 - 3:31"}, {"from"=>255.897, "to"=>267.897, "fname"=>"20284118_1", "title"=>"1st quarter, 3:22 - 4:34"}, {"from"=>307.51, "to"=>319.51, "fname"=>"20278937_1", "title"=>"1st quarter, 4:34 - 4:46"}, {"from"=>503.728, "to"=>515.728, "fname"=>"20274952_1", "title"=>"1st quarter, 4:52 - 4:04"}, {"from"=>554.848, "to"=>566.848, "fname"=>"20274956_1", "title"=>"1st quarter, 4:20 - 5:32"}, {"from"=>441.855, "to"=>453.855, "fname"=>"20287641_1", "title"=>"1st quarter, 6:35 - 6:47"}, {"from"=>422.004, "to"=>434.004, "fname"=>"20282215_1", "title"=>"1st quarter, 6:05 - 6:17"}, {"from"=>612.16, "to"=>624.16, "fname"=>"20281571_1", "title"=>"1st quarter, 6:06 - 6:18"}, {"from"=>752.638, "to"=>764.638, "fname"=>"20274952_1", "title"=>"1st quarter, 6:
View gist:23269cc96908dc9ebd589d38b45b4ead
<iframe width="1280" height="630" src="http://hockey.instatsport.com" frameborder="0" allowfullscreen></iframe>
View gist:bd7e1d6955eb8661b958e6b2acc2e946
<iframe width="1280" height="630" src="http://localhost:3000" frameborder="0" allowfullscreen></iframe>
View geoip
pry(#<Api::V1::Geo::GeoController>)> ggg = db.lookup(@ip)
=> #<MaxMindDB::Result:0x00000009b39cd8
@raw=
{"city"=>
{"geoname_id"=>551487,
"names"=>
{"de"=>"Kasan", "en"=>"Kazan’", "es"=>"Kazán", "fr"=>"Kazan", "ja"=>"カザン", "pt-BR"=>"Cazã", "ru"=>"Казань", "zh-CN"=>"喀山"}},
"continent"=>
{"code"=>"EU",
"geoname_id"=>6255148,
You can’t perform that action at this time.