Skip to content

Instantly share code, notes, and snippets.

@gavinheavyside
gavinheavyside / fizzbuzz.rb
Last active September 27, 2019 08:43 — forked from mrb/fizzbuzz.rb
Writing FizzBuzz without modulus division or 'if'
fizz = [nil, nil, "Fizz"].cycle
buzz = [nil, nil, nil, nil, "Buzz"].cycle
(1..100).zip(fizz, buzz) do |num, *fb|
puts fb.compact.reduce(:+) || num
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.heavyside.redis</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/redis-server</string>
<string>/usr/local/etc/redis.conf</string>
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid