Skip to content

Instantly share code, notes, and snippets.

@benaubin
benaubin / mysql-god.rb
Last active March 6, 2016 04:40 — forked from traviskroberts/mysql.rb
a nice way of auto restarting mysql
# run in non-daemonized mode (so you can monitor it) with `god -c /path/to/mysql.god -D`
# run normally with `god -c /path/to/mysql.god`
God.watch do |w|
# you can name this whatever you want
w.name = "mySQL"
# polling interval
w.interval = 30.seconds
@benaubin
benaubin / word.rb
Last active February 15, 2016 22:25 — forked from lpar/pwgen.rb
Simple generation of readable random made-up words using Ruby
#!/usr/bin/env ruby
# encoding: UTF-8
# Simple word gen in Ruby.
#
# Example:
#
# gen
# gen 10
# gen 7, "prefix-"

Syntax

All target selectors start with @. The following character is the selector type. For example, @p means 'closest player'.

Target selectors may have additional, optional arguments. You can specify these in [ ], using the syntax a=0. For example, @p[a=0,b=5,c=-500].

There is a special short syntax for just specifying x, y, z and r arguments; simply list their values separated by a comma, without x=. For example: @p[100,64,-100,5] for 5 range, x=100, y=64 and z=-100. Each of these are optional and skippable by leaving them empty. For example, to just specify y coordinate: @p[,64].

Global Arguments:

(Case sensitive)

  • x - X coordinate for search center. Default is senders coordinate, or 0.