This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCinchPlugin | |
include Cinch::Plugin | |
react_on :channel | |
match /hello/, method: :execute_hello | |
def execute_hello m | |
m.reply "Hello, #{m.user.nick}!" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Games | |
module Acro | |
class Game | |
attr_reader :acronym | |
attr_reader :answers | |
attr_reader :voters | |
def initialize acronym = nil | |
@acronym = acronym ||= Random.new.rand(3..10).times.map { [*?A...?Z].sample }.join | |
@answers = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Games | |
module Acro | |
class Game | |
attr_reader :acronym | |
attr_reader :answers | |
attr_reader :voters | |
def initialize acronym = nil | |
@acronym = acronym ||= Random.new.rand(3..10).times.map { [*?A...?Z].sample }.join | |
@answers = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'obj_ext/string' | |
module Plugins | |
class RemoteAdmin | |
include Cinch::Plugin | |
set help: "Relays certain messages to logged-in admins.", required_options: [:admins] | |
listen_to :notice | |
listen_to :private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'singleton' | |
require 'digest/sha2' | |
class Admin | |
include Singleton | |
attr_reader :masks | |
attr_accessor :password | |
def initialize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Should really make a note here: | |
# This class currently only accepts arrays of data that has separators, rather than being a two-dimensional array. This will be fixed at some point. | |
# It will also not take a single string, or other types of collections. This will also be fixed at some point (in that case, table headings would have to be revamped to allow key->value pairings. | |
# - Mark | |
# -*- coding: utf-8 -*- | |
require 'active_support/core_ext/object/blank' | |
module Helpers | |
# Formats a supplied array into a list or table. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'modules/helpers/table_format' | |
module Plugins | |
module Admin | |
class Handler | |
include Cinch::Plugin | |
set( | |
plugin_name: "admin", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
mli: | |
My site: http://insomniafanfics.weebly.com | |
Tumblr: http://mylittleinsomnia.tumblr.com | |
Facebook: http://www.facebook.com/profile.php?id=100001428581452 | |
PonySquare: http://ponysquare.com/profile-2220/ | |
Twitter: https://twitter.com/#!/DJINs0mnIAK | |
Skype: legit.sketchy | |
E-mail: insomnia@ponify.me | |
XboxLIVE Gamertag: ThatGuyEcho |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Observations from below: nil gets sent, so that overrides any defaults. | |
Search should be switched over to named params. | |
<@Azure> !tw | |
<@Aiko_> TWITTER: tweet_by_username - params: {:username=>nil, :nth_tweet=>nil} | |
<@Azure> !tw azuretan | |
<@Aiko_> TWITTER: tweet_by_username - params: {:username=>"azuretan", :nth_tweet=>nil} | |
<@Azure> !tw azuretan+10 | |
<@Aiko_> TWITTER: tweet_by_username - params: {:username=>"azuretan", :nth_tweet=>"10"} | |
<@Azure> @ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @author Mark Seymour (mark.seymour.ns@gmail.com) | |
require 'date' | |
class Person | |
attr_accessor :first_name | |
attr_accessor :last_name | |
attr_accessor :birthday | |
# @param [String] The person's first name |
OlderNewer