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
AllCops: | |
Exclude: | |
- db/**/* | |
Style/FileName: | |
Enabled: false | |
StringLiterals: | |
Enabled: false |
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
none_shall_pass = """ | |
Flash that buttery gold, jittery zeitgeist | |
Wither by the watering hole, Border patrol | |
What are we to Heart Huckabee | |
Art fuckery suddenly | |
Not enough young in his lung for the water wings | |
Colorfully vulgar poacher, out of mulch | |
Like I'm a pull the pulse out a soldier and bolt | |
Fine, sign of the time we elapse | |
When a primate climb up a spine and attach |
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 'bunny' | |
require 'json' | |
require 'pry' | |
class MessageQueue | |
attr_reader :channel, :service, :queue | |
def initialize(service, channel) | |
@channel = channel | |
@service = service |
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 'json' | |
module Jekyll | |
module JsonContent | |
class Index < Jekyll::Page | |
attr_reader :page | |
def initialize site, base, dir, page | |
@site = site |
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
express = require 'express' | |
socket = require 'socket.io' | |
{ Server } = require 'http' | |
app = express() | |
http = Server app | |
io = socket http | |
app.get '/', (request, response) -> response.sendFile 'index.html' | |
io.on 'connection', (socket) -> console.log 'User connected' |
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 'minitest/autorun' | |
require 'minitest/pride' | |
class ListStrategy | |
attr_reader :dates, :foods | |
def initialize list | |
foods = list.map { |item| item.keys.map(&:to_s) } | |
@dates = list.map { |item| item.fetch(:date) } | |
@foods = foods.flatten.uniq - ['date'] |
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 Burrito | |
attr_reader :fillings | |
def initialize(*fillings) | |
@fillings = fillings | |
end | |
def to_hash | |
{ burrito: { filling: fillings.map(&:to_s) } } | |
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
burrito-tropical=# select * from labels; | |
id | message_id | account_id | content | created_at | updated_at | |
-----+------------+------------+--------------------------------+------------+------------ | |
441 | | | {1} | | | |
442 | | | {Inbox,Unread} | | | |
443 | | | {Inbox} | | | |
444 | | | {Request,Inbox,Papaya,Burrito} | | | |
445 | | | {Request,Inbox,Papaya,Burrito} | | | |
446 | | | {Request,Inbox,Papaya,Burrito} | | | |
447 | | | {Request,Burrito} | | |
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 Choice | |
attr_reader :actions, :command | |
def initialize options = Hash.new | |
@actions = options.fetch(:actions) { Actions::List.new } | |
@command = options.fetch(:command) { :default } | |
end | |
def call movies | |
actions.for_choice(self).call movies |
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
SingletonExample = | |
do -> | |
privateFunction = -> "I'm so hidden" | |
publicFunction = -> alert privateFunction() | |
publicFunction: publicFunction | |
SingletonExample.publicFunction() | |
alert SingletonExample.privateFunction() |