This file contains hidden or 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
def assign_value(lib, left, right) | |
lib[left] = !lib[right] if lib[left] == nil | |
lib[right] = !lib[left] if lib[right] == nil | |
return lib | |
end | |
def can_be_grouped?(edges) | |
# Initialize lib - use first edge / first node |
This file contains hidden or 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
// Define WebSocket using ws library | |
const WebSocket = require('ws'); | |
// Initialise wss as a new Websocket Server running in port 8989 | |
const wss = new WebSocket.Server({ port: 8989 }); | |
// Array of users currently logged in. Serves as the Database. | |
var users = []; | |
// This is the code that will run on the server when a new client is connected to |
This file contains hidden or 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
# This Rails Model can be used to generate a PDF, upload to AWS, and store bucket/key | |
# of the PDF. Uses Wicked PDF and the AWS SDK. | |
# | |
# Gems: | |
# gem 'aws-sdk' # https://github.com/aws/aws-sdk-ruby | |
# gem 'wicked_pdf' # https://github.com/mileszs/wicked_pdf | |
# | |
# Sources: | |
# https://github.com/thoughtbot/paperclip/wiki/PDF-Email-Attachments-with-Paperclip-and-wicked_pdf | |
# https://gist.github.com/micahroberson/5988843 |