Skip to content

Instantly share code, notes, and snippets.

View Unkas82's full-sized avatar

Timko Unkas82

  • Ukraine
View GitHub Profile
{"f_match_event"=>"1238233", "c_match_event_prop"=>"24", "value"=>"63", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"1238262", "c_match_event_prop"=>"24", "value"=>"63", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"9711581", "c_match_event_prop"=>"24", "value"=>"63", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"9706136", "c_match_event_prop"=>"24", "value"=>"63", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"9742693", "c_match_event_prop"=>"24", "value"=>"62", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"1894349", "c_match_event_prop"=>"26", "value"=>"62", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"2150517", "c_match_event_prop"=>"24", "value"=>"63", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"2153454", "c_match_event_prop"=>"24", "value"=>"63", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"2156318", "c_match_event_prop
{"f_match_event"=>"527967", "c_match_event_prop"=>"15", "value"=>"8336", "c_match_event_prop_value"=>nil, "f_player"=>"8336"}
{"f_match_event"=>"1894349", "c_match_event_prop"=>"15", "value"=>"4386", "c_match_event_prop_value"=>nil, "f_player"=>"4386"}
{"f_match_event"=>"4645987", "c_match_event_prop"=>"15", "value"=>"7466", "c_match_event_prop_value"=>nil, "f_player"=>"7466"}
{"f_match_event"=>"4645988", "c_match_event_prop"=>"15", "value"=>"7467", "c_match_event_prop_value"=>nil, "f_player"=>"7467"}
{"f_match_event"=>"1894349", "c_match_event_prop"=>"16", "value"=>"18.755980861244", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"1894349", "c_match_event_prop"=>"17", "value"=>"7.1791044776119", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"1894349", "c_match_event_prop"=>"26", "value"=>"62", "c_match_event_prop_value"=>nil, "f_player"=>nil}
{"f_match_event"=>"3121445", "c_match_event_prop"=>"16", "value"=>"20.3875", "c_match_event_prop_value"=>nil, "f_player"=>nil
[5] pry(main)> wtf???!!!
Exception: NoMethodError: undefined method `to_sym' for nil:NilClass
Did you mean? to_s
--
0: /var/lib/gems/2.3.0/gems/activerecord-4.2.3/lib/active_record/sanitization.rb:59:in `block in expand_hash_conditions_for_aggregates'
1: /var/lib/gems/2.3.0/gems/activerecord-4.2.3/lib/active_record/sanitization.rb:58:in `each'
2: /var/lib/gems/2.3.0/gems/activerecord-4.2.3/lib/active_record/sanitization.rb:58:in `expand_hash_conditions_for_aggregates'
3: /var/lib/gems/2.3.0/gems/activerecord-4.2.3/lib/active_record/relation/query_methods.rb:957:in `build_where'
4: /var/lib/gems/2.3.0/gems/activerecord-4.2.3/lib/active_record/relation/query_methods.rb:584:in `where!'
5: /var/lib/gems/2.3.0/gems/activerecord-4.2.3/lib/active_record/relation/query_methods.rb:574:in `where'
"{\"players\":[{\"id\":238821,\"name\":\"Vinicius Rodolfo\",\"surname\":\"de Souza Oliveira\",\"nickname\":\"\",\"birth_date\":\"27.03.1995\",\"has_photo\":1,\"pref_foot\":null,\"weak_foot\":null,\"team_id\":390,\"national_team_id\":null,\"contract_expire_date\":null,\"team_name\":\"Botafogo RJ\",\"national_team_name\":null,\"citizenship\":[\"Brazil\"],\"positions\":[{\"title\":\"Forward\",\"percent\":80},{\"title\":\"Right midfielder\",\"percent\":11},{\"title\":\"Defensive midfielder\",\"percent\":7}],\"events\":[{\"pos_x\":57.3,\"pos_y\":44.0},{\"pos_x\":57.3,\"pos_y\":44.0},{\"pos_x\":86.7,\"pos_y\":63.6},{\"pos_x\":92.6,\"pos_y\":65.2},{\"pos_x\":77.7,\"pos_y\":8.5},{\"pos_x\":78.1,\"pos_y\":12.1},{\"pos_x\":87.1,\"pos_y\":44.0},{\"pos_x\":61.3,\"pos_y\":19.0},{\"pos_x\":61.3,\"pos_y\":19.0},{\"pos_x\":36.5,\"pos_y\":66.9},{\"pos_x\":44.9,\"pos_y\":58.4},{\"pos_x\":2.4,\"pos_y\":66.3},{\"pos_x\":1.1,\"pos_y\":64.5},{\"pos_x\":1.9,\"pos_y\":65.2},{\"pos_x\":9.0,\"pos_y\":55.7},{\"pos_x\":12.0,\"pos_y\":56
<Event _id: 57e6882d6d632e50ab005245, event_id: 205272, action_code: 3040, type: "offside", title: "Offside", standard: nil, half: 2, seconds: 4126, pos_x: 86.0, pos_y: 60.0, pos_dest_x: 0.0, pos_dest_y: 0.0, url: "388939_2.mp4?start=1416&end=1436", start: 1416, end: 1436, offset_left: 0.0, fitness: nil, match_id: BSON::ObjectId('57e688046d632e50abf24b45'), player_id: 3895, team_id: 146, opponent_player_id: 0, opponent_team_id: nil>,
<Event _id: 596873d3165d87bb05018daa, event_id: 205272, action_code: 4040, type: "shot", title: "Shot blocked", standard: nil, half: 1, seconds: 1345, pos_x: 83.0, pos_y: 35.0, pos_dest_x: 96.0, pos_dest_y: 30.0, url: "583307_1.mp4?start=1335&end=1355", start: 1335, end: 1355, offset_left: 0.0, fitness: nil, match_id: BSON::ObjectId('5919ae52165d8771f374c0f2'), player_id: 120024, team_id: 1981, opponent_player_id: 63863, opponent_team_id: nil>,
<Event _id: 5975e099165d873c445b6a7a, event_id: 205272, action_code: 8010, type: "goal", title: "Goal", standard: nil, half: 2, seconds
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,
<iframe width="1280" height="630" src="http://localhost:3000" frameborder="0" allowfullscreen></iframe>
<iframe width="1280" height="630" src="http://hockey.instatsport.com" frameborder="0" allowfullscreen></iframe>
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:
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