nikivi

Activity Graph

Page 1 of 2 | Next »

2018-09-10

[11:27:32] nikivi: has left #ruby: ()

2018-09-07

[03:18:21] nikivi: Ping timeout: 252 seconds
[03:25:27] nikivi: has joined #ruby

2018-09-06

[01:09:30] nikivi: Ping timeout: 252 seconds
[02:17:57] nikivi: has joined #ruby
[03:16:00] nikivi: Ping timeout: 252 seconds
[03:42:30] nikivi: has joined #ruby

2018-09-05

[01:06:33] nikivi: Ping timeout: 252 seconds
[03:10:49] nikivi: Read error: Connection reset by peer

2018-09-04

[08:52:13] nikivi: Quit: ZNC is awesome
[08:56:08] nikivi: has joined #ruby
[10:54:01] nikivi: Quit: ZNC is awesome
[11:02:58] nikivi: has joined #ruby

2018-09-03

[17:37:14] nikivi: Quit: ZNC is awesome
[17:44:22] nikivi: has joined #ruby

2018-08-22

[09:59:20] nikivi: has joined #ruby

2018-08-21

[08:12:40] nikivi: has joined #ruby
[15:45:22] nikivi: Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net
[17:20:03] nikivi: Quit: ZNC is awesome
[17:20:30] nikivi: has joined #ruby
[22:00:27] nikivi: Quit: ZNC is awesome

2018-08-20

[23:22:01] nikivi: Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net

2018-08-19

[14:33:37] nikivi: can someone help with a script I am writing
[14:33:38] nikivi: https://github.com/nikitavoloboev/karabiner-generator/blob/master/config.rb
[14:34:03] nikivi: it is basically generating JSON however the issue I have is that it doesn't generate commas after the blocks
[14:34:22] nikivi: so I am forced to add those print(',') statements in the def main
[14:43:52] nikivi: yeah you are right konsolebox
[14:44:00] nikivi: it generates {}
[14:44:11] nikivi: I just want it to generate {},
[14:44:24] nikivi: and then I will add final print(',') in the end of def main
[14:45:04] nikivi: konsolebox not sure how I can refactor is so I do it all in one pretty_generate
[14:46:34] nikivi: Zarthus not sure
[14:46:46] nikivi: it is modification of a script done by another person
[14:46:49] nikivi: it works though
[14:47:06] nikivi: Zarthus I also split it up into methods
[14:47:42] nikivi: the generated code is not valid JSON in that it goes inside [] of JSON structure
[14:47:48] nikivi: it goes inside an array
[14:48:16] nikivi: https://github.com/nikitavoloboev/karabiner-generator#readme
[14:48:21] nikivi: gives description
[14:48:37] nikivi: basically I generate the code and paste it inside rules [] block
[14:49:38] nikivi: konsolebox can you give an example of how that will look please?
[14:55:27] nikivi: but I am still dealing with raw JSON
[14:55:35] nikivi: dont see why that is differt to what I am doing now
[15:00:47] nikivi: konsolebox I can just put that now in my code?
[15:00:50] nikivi: or I have to make some changes
[15:06:56] nikivi: I am a bit confused by what you meant there

2018-08-18

[15:47:55] nikivi: has joined #ruby
[15:48:08] nikivi: when you require a relative file
[15:48:28] nikivi: is it possible to use the methods as stated in the file as if they were written in the file you are requiring from?
[15:56:33] nikivi: for example I have method 'def shell()' in file karabiner.rb
[15:57:00] nikivi: and inside config.rb in the same dir that karabiner.rb is, I do 'require_relative 'karabiner.rb''
[15:57:28] nikivi: but then I can't just call the methods from karabiner.rb bare like 'shell()'
[15:57:34] nikivi: is it possible to make that happen?
[15:59:21] nikivi: havenwood https://github.com/nikitavoloboev/karabiner-generator
[15:59:32] nikivi: check karabiner.rb which has many methods
[15:59:39] nikivi: and config.rb where I try to call them
[16:00:34] nikivi: what does that mean?
[16:02:08] nikivi: not too familiar with modules, reading it now
[16:02:15] nikivi: do I have to wrap all my methods as module?
[16:02:31] nikivi: is there no way to just require the thing and use its methods as if they are in the same file
[16:03:34] nikivi: from config.rb:34:in `<main>'
[16:03:34] nikivi: config.rb:14:in `main': undefined method `simkeys' for main:Object (NoMethodError)
[16:03:43] nikivi: I get this error trying to call rb on config.rb
[16:04:28] nikivi: I think its due to main
[16:04:32] nikivi: it has to be at the bottom
[16:04:47] nikivi: okay I think it works now
[16:04:56] nikivi: I just though I could call main right after def main
[16:05:04] nikivi: and still do def's after main call
[16:05:30] nikivi: yeah makes sense
[16:05:33] nikivi: just in JS you can do that
[16:05:46] nikivi: declare stuff at end of files and use it earlier
[16:07:55] nikivi: thanks havenwood
[16:08:00] nikivi: but it seems I dont need modules in this case
[16:08:07] nikivi: it seems to work like I want

2018-08-08

[23:02:49] nikivi: *.net *.split

2018-07-20

[00:07:18] nikivi: *.net *.split
[00:15:51] nikivi: has joined #ruby
[04:09:49] nikivi: Quit: ZNC 1.6.6 - http://znc.in
[07:14:48] nikivi: has joined #ruby

2018-07-08

[09:13:48] nikivi: if I want to return a value from a method as string, do I print it out?
[09:14:09] nikivi: I read in ruby you don't excplitly return things
[09:14:17] nikivi: the last evaluated is returned
[09:15:40] nikivi: livcd whats sorbet.rb?
[09:15:45] nikivi: I googled it got nothing
[09:15:56] nikivi: https://github.com/circlesabound/sorbet
[09:16:11] nikivi: https://github.com/stripe/stripe-ruby
[09:16:13] nikivi: oh this one?
[09:16:21] nikivi: nvm thats API lol
[09:16:28] nikivi: typechecker would be neat indeed
[09:16:35] nikivi: I come to ruby from Go and love static typing
[09:16:40] nikivi: but ruby feels really nice to write in
[09:17:22] nikivi: livcd will it work like Flow for JS?
[09:17:25] nikivi: you annotate the types?
[10:49:49] nikivi: is it possible to know from where the method is being called in ruby?
[10:50:12] nikivi: i.e. I have this code https://github.com/nikitavoloboev/karabiner-generator/blob/master/karabiner-generate.rb#L27
[10:50:27] nikivi: And I want to drop the first argument to the method sticky
[10:50:45] nikivi: because all method calls in sticky_w, will have 'w' as first arg
[10:50:48] nikivi: I don't want to repeat it
[10:52:19] nikivi: leitz yeah
[10:52:30] nikivi: then I can check suffix of method and grab it from there
[10:52:38] nikivi: def sticky_s() -> will get me s
[10:57:54] nikivi: this is currently executed method
[10:58:31] nikivi: https://hastebin.com/simijanule.rb
[10:58:32] nikivi: what I want
[11:01:11] nikivi: perfect, thanks leitz
[11:01:29] nikivi: ACTION should learn to Google
[11:21:26] nikivi: what are your thoughts on Elixir?
[11:21:34] nikivi: I read that its a faster concurrent ver. of ruby
[11:26:38] nikivi: def key(sticky_key, action_key, modifiers=nil)
[11:26:51] nikivi: If I do this it means I can skip modifiers in method call?
[11:26:55] nikivi: and it will be nil then
[14:00:03] nikivi: are modules uppercased in ruby?
[14:00:09] nikivi: or you can lowercase them too?
[14:17:32] nikivi: https://hastebin.com/zomiboroki.rb
[14:17:42] nikivi: I have this code, why can't I do if statement on line 16
[14:18:10] nikivi: basically I want to only assign something to 'modifiers' if to_modifiers is not nil
[14:18:24] nikivi: 'modifiers' => to_modifiers
[14:18:24] nikivi: karabiner-generate.rb:157: syntax error, unexpected =>, expecting keyword_end
[14:18:26] nikivi: I get this erro
[14:22:27] nikivi: oh I guess in that if block, the assignment can't take place
[14:22:34] nikivi: what is the best way to do what I want?
[14:22:49] nikivi: right now it assigns null to that field, I don't want that
[14:23:13] nikivi: I don't want to evaluate this line at all if there is nil: 'modifiers' => to_modifiers
[14:23:55] nikivi: I can think of a hacky way to wrap the entire thing in if but that's ugly
[14:24:28] nikivi: can you give example of it please?
[14:25:31] nikivi: this removes the field entirely right?
[14:25:41] nikivi: oh I see now
[14:25:52] nikivi: I was thinking of overwriting it :)
[14:25:54] nikivi: will try now
[14:26:44] nikivi: sweet that worked
[14:27:03] nikivi: the JSON spec, doesn't accept null value there
[14:27:13] nikivi: it either exists with some value or doesn't
[14:28:11] nikivi: it added null field for me
[14:28:19] nikivi: https://hastebin.com/nujakuyera.json
[14:28:27] nikivi: if you look at bottom
[14:28:43] nikivi: https://pqrs.org/osx/karabiner/json.html#root-data-structure
[15:32:46] nikivi: def sticky(held_key, trigger_key, action, from_mandotary_modifiers=[], to_modifiers=[])
[15:32:52] nikivi: I can do this right?
[15:33:02] nikivi: from_mandotary_modifiers if not passed will take value of empty array
[15:33:09] nikivi: same for to_modifiers
[19:05:50] nikivi: can someone help think through how one can solve on issue in ruby
[19:06:24] nikivi: I have this code https://hastebin.com/icitahunez.php
[19:06:42] nikivi: it basically generates JSON that an app then uses to rebind keyboard
[19:06:50] nikivi: there are two methods, shell and key
[19:07:11] nikivi: where each one binds a single key to another key, so say I press s key, then hold it and press g and it does something
[19:07:39] nikivi: I need a way to define that when I press some key, it pressed multiple keys after so I press s, then it will insert g, f, l and so on
[19:07:54] nikivi: so I want to create a method multiple_keys but not sure how to go from there really
[19:08:01] nikivi: I was thinking of using key() method somehow
[19:08:13] nikivi: its a bit abstract I know
[19:08:49] nikivi: Zarthus this is snippet from previous config https://hastebin.com/ripicikuga.php
[19:09:04] nikivi: what that did was made it so that if you press b, it will insert TODO: in sucession
[19:09:24] nikivi: so it will trigger T (with shift held, then O (with shift)..
[19:09:55] nikivi: take a look at key() method, see if it makes sense a bit
[19:10:50] nikivi: there is held_trigger which is key being held down, then trigger_key which is the key that will be pressed when that key is held down and key_code is what will be inserted once that happens
[19:11:01] nikivi: but this does it for 1 key only
[19:11:28] nikivi: whatever I define to happen
[19:11:35] nikivi: it can insert o key for example
[19:11:53] nikivi: but what I want it to do now is to define s + i to insert todo in succession
[19:12:01] nikivi: no you hold down s, then press i
[19:12:04] nikivi: and o comes on screen
[19:12:12] nikivi: you can release s after if you want
[19:12:17] nikivi: s is like modifer key
[19:12:39] nikivi: so that stuff I can do, one to one mappings
[19:12:48] nikivi: but I have trouble how I can extend it to multiple key calls
[19:12:58] nikivi: I guess I have to use array in some way
[19:13:07] nikivi: but the thing is that those keys can also have modifiers
[19:14:01] nikivi: is there a way I can have some complicated arguments in a method call
[19:14:16] nikivi: although not sure that would help
[19:15:03] nikivi: key("q", "l", "l", ["command", "shift"]).key("q", "l", "o", ["command", "shift"]),
[19:15:09] nikivi: I am thinking of going for this kind of API
[19:15:19] nikivi: where I bind calls together with dot
[19:15:46] nikivi: but then that won't work either mm
[19:15:51] nikivi: in what way they are wrong?
[19:15:54] nikivi: limiting sure
[19:16:06] nikivi: but those args are enough to do the one time binds s + i
[19:16:35] nikivi: there should only be one trigger key thats fine
[19:16:47] nikivi: s + i -> triggers something
[19:16:57] nikivi: but that something currently can be only one keybind called, I want multiple
[19:16:59] nikivi: thats the issue
[19:17:33] nikivi: so key_code should be changed
[19:17:39] nikivi: to array of key_code maybe
[19:17:57] nikivi: but I also have to specify modifiers to the key_code (to each one)
[19:18:03] nikivi: currently I do that as two other args
[19:18:13] nikivi: calling the method twice wouldn't work
[19:18:48] nikivi: or well it would if I call it with different arguments but the method calls would be called from original call
[19:27:09] nikivi: so can I do this somehow?
[19:27:14] nikivi: key("i", "b", "T", ["shift"]).key('O', ['shift']),

2018-05-29

[02:47:09] nikivi: *.net *.split
[02:48:12] nikivi: has joined #ruby

2018-04-25

[12:25:46] nikivi: *.net *.split
[12:27:20] nikivi: has joined #ruby
[15:01:16] nikivi: *.net *.split
[15:03:17] nikivi: has joined #ruby

2018-04-10

[21:23:45] nikivi: has joined #ruby

2018-04-09

[12:57:13] nikivi: Quit: ZNC 1.6.6 - http://znc.in
[19:35:02] nikivi: has joined #ruby
[19:51:32] nikivi: Quit: ZNC 1.6.6 - http://znc.in

2018-04-06

[01:39:41] nikivi: has joined #ruby

2018-04-05

[22:06:21] nikivi: Read error: Connection reset by peer

2018-03-24

[23:25:17] nikivi: Quit: ZNC 1.6.6 - http://znc.in
[23:26:31] nikivi: has joined #ruby

2018-03-23

[14:00:19] nikivi: Quit: ZNC 1.6.6 - http://znc.in
[14:29:08] nikivi: has joined #ruby

2018-03-20

[09:31:13] nikivi: has joined #ruby

2018-03-19

[23:39:57] nikivi: Remote host closed the connection

2018-02-05

[14:42:42] nikivi: Quit: ZNC 1.6.5 - http://znc.in
[14:46:04] nikivi: has joined #ruby

2018-01-28

[04:15:03] nikivi: Quit: ZNC 1.6.5 - http://znc.in
[04:41:37] nikivi: has joined #ruby

2017-12-12

[20:35:46] nikivi: Ping timeout: 264 seconds
[20:39:42] nikivi: has joined #ruby

2017-12-07

[14:48:17] nikivi: *.net *.split
[14:54:21] nikivi: has joined #ruby
[21:43:03] nikivi: *.net *.split
[21:48:18] nikivi: has joined #ruby
[22:37:00] nikivi: *.net *.split
[22:42:08] nikivi: has joined #ruby

2017-12-01

[02:28:59] nikivi: has joined #ruby

2017-11-06

[22:27:00] nikivi: has left #RubyOnRails: ("Textual IRC Client: www.textualapp.com")

2017-10-31

[10:01:05] nikivi: Ping timeout: 240 seconds
[10:01:59] nikivi: has joined #ruby
[10:03:43] nikivi: has joined #RubyOnRails

2017-10-23

[12:42:18] nikivi: has joined #ruby
[12:43:16] nikivi: has joined #RubyOnRails

2017-10-22

[18:58:39] nikivi: Ping timeout: 248 seconds

2017-10-21

[08:41:35] nikivi: Quit: ZNC 1.6.5 - http://znc.in
[09:23:09] nikivi: has joined #RubyOnRails
[09:23:48] nikivi: has joined #ruby
[09:23:57] nikivi: Remote host closed the connection
[09:27:29] nikivi: has joined #ruby
[09:27:51] nikivi: has joined #RubyOnRails

2017-10-17

[16:36:22] nikivi: Ping timeout: 264 seconds
[16:57:04] nikivi: has joined #ruby
[16:58:43] nikivi: has joined #RubyOnRails

2017-10-16

[06:26:58] nikivi: Ping timeout: 269 seconds
[06:29:29] nikivi: has joined #ruby
[06:31:08] nikivi: has joined #RubyOnRails

2017-10-12

[01:33:42] nikivi: has joined #ruby
[01:35:22] nikivi: has joined #RubyOnRails

2017-09-12

[23:48:54] nikivi: Ping timeout: 240 seconds
[23:49:33] nikivi: has joined #ruby
[23:51:14] nikivi: has joined #RubyOnRails

2017-08-14

[01:13:28] nikivi: has joined #RubyOnRails
[01:14:05] nikivi: has joined #ruby