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
| Class Main { | |
| public void bfs() | |
| { | |
| // BFS uses Queue data structure | |
| Queue queue = new LinkedList(); | |
| queue.add(this.rootNode); | |
| printNode(this.rootNode); | |
| rootNode.visited = true; | |
| while(!queue.isEmpty()) { | |
| Node node = (Node)queue.remove(); |
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 file is used by Rack-based servers to start the application. | |
| require ::File.expand_path('../config/environment', __FILE__) | |
| require ::File.expand_path('../lib/devise_basic_auth_fix', __FILE__) | |
| use DeviseBasicAuthFix | |
| run MyApp::Application |
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
| require 'httparty' | |
| require 'json' | |
| class Campfire | |
| include HTTParty | |
| base_uri 'https://YOUR_DOMAIN.campfirenow.com' | |
| basic_auth 'YOUR_API_KEY', 'X' # yes, that is a literal X string. it's needed to satisfy basic_auth(), but campfire ignores it. | |
| headers 'Content-Type' => 'application/json' | |
| def self.speak(message) |
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
| # mongo_template.rb | |
| # fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842) | |
| # | |
| # To use: | |
| # rails project_name -m http://gist.github.com/gists/219223.txt | |
| # remove unneeded defaults | |
| run "rm public/index.html" | |
| run "rm public/images/rails.png" | |
| run "rm public/javascripts/controls.js" |
NewerOlder