This file contains hidden or 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
module Justclick::Api | |
class Interactor | |
def invoke_method(method, data, allowed_codes: [0, 601]) | |
check_response_status( | |
ParamsDecoder.decode( | |
http_client.post( | |
[ | |
"http://", | |
Rails.application.secrets.justclick[:user], | |
".justclick.ru/api/", |
This file contains hidden or 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
module Vk::Web | |
class Authenticator | |
VK_VIEWER_TYPES = %i[not_participant participant moderator editor administrator].freeze | |
def initialize(params:) | |
@params = params | |
end | |
def real_viewer? | |
api_id_valid? && auth_key_valid? && signature_valid? |
This file contains hidden or 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 DeferredComponent; | |
DeferredComponent = React.createClass({ | |
propTypes: { | |
componentName: React.PropTypes.string.isRequired | |
}, | |
getInitialState: function() { | |
return { | |
resolvedComponent: null, |
This file contains hidden or 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
module.exports = { | |
componentWillUnmount: function() { | |
this.endFocusMonitor(); | |
}, | |
startFocusMonitor: function() { | |
document.addEventListener('focusin', this.checkFocusTarget); | |
document.addEventListener('click', this.checkFocusTarget); | |
}, |
This file contains hidden or 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
group :test do | |
gem 'guard' | |
### | |
gem 'rb-fsevent', '~> 0.9.1', require: (RUBY_PLATFORM.downcase.include?("darwin") && 'rb-fsevent') | |
gem 'rb-inotify', '~> 0.8.8', require: (RUBY_PLATFORM.downcase.include?("linux") && 'rb-inotify') | |
end |
This file contains hidden or 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
angular | |
.module('ContentRepeat', []) | |
.directive 'contentrepeat', ($compile) -> | |
priority: 1000 | |
terminal: true | |
compile: (element, attr, linker) -> | |
template = $compile(element.html()) | |
element.empty() | |
(scope, self, attr) -> |
This file contains hidden or 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
require 'digest/md5' | |
require 'uri' | |
# this code works fine in some of my projects, but I'm just lazy to document it well... | |
# so, feel free to use it after full review of logic (is it matching your purposes?) | |
# at your own risk, of course! :) | |
class RobokassaMerchant | |
class << self | |
def signed_start_params objects_amount, objects_filter, objects_cost, user |
This file contains hidden or 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
# requires socksify gem | |
require "socksify" | |
require 'socksify/http' | |
# use w/ OAuth2 like OAuth2::Client.new(id, secret, connection_opts: { proxy: 'socks://127.0.0.1:9050' }) | |
class Faraday::Adapter::NetHttp | |
def net_http_class(env) | |
if proxy = env[:request][:proxy] | |
if proxy[:uri].scheme == 'socks' | |
Net::HTTP::SOCKSProxy(proxy[:uri].host, proxy[:uri].port) |