Skip to content

Instantly share code, notes, and snippets.

View darelvc's full-sized avatar

Oleg Bloshenkin darelvc

  • Playtika Ltd
  • Ukraine, Vinnitsia
View GitHub Profile
@darelvc
darelvc / JqDH-12.rb
Created July 31, 2017 11:24
null created by darelvc - https://repl.it/JqDH/12
require 'json'
a = { "system": {"cpu": {"softirq": {"pct": 0}, "idle": {"pct": 0.992}, "steal": {"pct": 0}, "cores": 1, "system": { "pct": 0.0003 }, "iowait": { "pct": 0.007 }, "irq": { "pct": 0 }, "user": { "pct": 0.0007 }, "nice": { "pct": 0 } }} }
parsed = a.to_json
json_parsed = JSON.parse(parsed)
global_key = json_parsed.keys()
@darelvc
darelvc / Chats_controller.rb
Created March 11, 2016 08:02
Chats_controller.rb
class Api::ChatsController < Api::BaseController
load_and_authorize_resource
private
def build_resource
@chat = Chat.build current_user, resource_params
end
def collection
#@chats ||= Chat.all.decorate