What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-06 17:31:07
sum all fields in nested json logstash
ruby { code => ' i = 0 sum = 0 while i < event.get( "[foo][bar][faz]" ).length do sum += event.get( "[foo][bar][faz][" + i.to_s + "][[baz]]" ) i += 1 end event.set( "sum", sum ) ' } Add solution -
Other 2021-09-17 01:29:02
nick j dotfiles
# I would consider these packages essential or very nice to have. The GTK # version of Vim is to get +clipboard support, you'd still run terminal Vim. sudo apt-get update && sudo apt-get install -y \ vim-gtk \ tmux \ git \ gpg \ curl \ ... Add solution -
Shell/Bash 2021-08-29 20:44:02
serve current directory from command line
#Simplest way possible (thanks Aaron Patterson/n0kada): ruby -run -e httpd . -p 9090 # I have this in my .bashrc : function serve { port="${1:-3000}" ruby -run -e httpd . -p $port } # It serves the current directory on port 3000 by defa... Add solution