Skip to content

Instantly share code, notes, and snippets.

View antonzhyliuk's full-sized avatar

Anton Žyluk antonzhyliuk

  • Lithuania, Vilnius
  • 20:46 (UTC +03:00)
View GitHub Profile
### Keybase proof
I hereby claim:
* I am antonzhyliuk on github.
* I am antonzhyliuk (https://keybase.io/antonzhyliuk) on keybase.
* I have a public key ASDoxzyIPBjaTBW2g8xg3L9xaoMj_t_YU8IPbYW9ZPr2_Ao
To claim this, I am signing this object:
@antonzhyliuk
antonzhyliuk / camera.cljs
Created January 10, 2018 18:56
react-native-camera with re-natal
(ns forest-community.components.camera
(:require [reagent.core :as r]))
(def ReactNative (js/require "react-native"))
(def text (r/adapt-react-class (.-Text ReactNative)))
(def view (r/adapt-react-class (.-View ReactNative)))
(def react-native-camera (js/require "react-native-camera"))
(def camera (-> react-native-camera
.-default
def dice_roll_chance_combined(dice_count:, expected_value:)
return 0.0 unless (dice_count..dice_count * 6).include?(expected_value)
if dice_count == 1
(1.to_f / 6).round(4)
elsif dice_count >= 5
dice_roll_chance_by_combinatorics(dice_count: dice_count, expected_value: expected_value)
else
dice_roll_chance_by_enumeration(dice_count: dice_count, expected_value: expected_value)
end
end
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')