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
# This can easily be snapped into the Openshift Sinatra Quickstart to drop the information from a HTML Form Post into Mongodb. | |
# You do need to have the Mongodb cartridge installed for this to work correctly. | |
require 'sinatra' | |
require 'mongo_mapper' | |
require 'json' | |
class User | |
include MongoMapper::Document | |
key :firstName, String |
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
--- | |
title: Games | |
slug: games | |
listed: false | |
published: true | |
cache_strategy: none | |
response_type: text/html | |
position: 102 | |
--- | |
{% extends parent %} |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.16' | |
gem 'locomotive_cms', '~> 2', :require => 'locomotive/engine' | |
# Gems used only for assets and not required | |
# in production environments by default. | |
group :assets do | |
gem 'compass-rails', '~> 1.1.3' | |
gem 'sass-rails', '~> 3.2.3' |
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
#!/bin/bash | |
/usr/bin/mongod --fork --syslog | |
cd /data/rails/locomotivecms/ |
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
#!/bin/bash | |
/usr/bin/mongod --fork --syslog | |
cd /data/rails/locomotivecms/ | |
source /etc/profile.d/rvm.sh | |
bundle exec unicorn_rails -D |
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
docker run -d --name mongodb dockerfile/mongodb mongod --noprealloc --smallfiles --rest --httpinterface | |
# use nsenter to enter it and find it's ip using 'ip addr' | |
### For future notes | |
### docker run -p 127.0.0.01:804:80 --link=mongodb:27017 --link=mongodb:28017 -d -e MONGODB_PORT_27017_TCP_ADDR="172.17.0.2" metakungfu/locomotive-cms | |
docker run -p 127.0.0.01:801:80 --link=mongodb:27017 --link=mongodb:28017 -d metakungfu/locomotive-cms | |
docker run -p 127.0.0.01:802:80 --link=mongodb:27017 --link=mongodb:28017 -d metakungfu/locomotive-cms | |
docker run -p 127.0.0.01:803:80 --link=mongodb:27017 --link=mongodb:28017 -d metakungfu/locomotive-cms |
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
#!/usr/bin/env ruby | |
require 'pp' | |
#Variables | |
maxElements = 100 | |
randomLowNumber = -10000 | |
randomHighNumber = 10000 | |
def quickSort( toSort ) |
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
#!/usr/bin/env ruby | |
require 'pp' | |
class BastardHashing | |
#Two arrays, index is the linking column | |
def initialize() | |
@keys = Array.new | |
@values = Array.new | |
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
#!/usr/bin/env ruby | |
# Snipped from: http://www.mikeperham.com/2014/11/26/building-a-binary-tree-with-enumerable/ | |
class Node | |
include Enumerable | |
attr_accessor :data, :left, :right | |
def initialize(data) | |
@data = data |
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
#!/usr/bin/env ruby | |
class Node | |
include Enumerable | |
attr_accessor :data, :children | |
def initialize( data ) | |
@data = data | |
@children = Array.new |
OlderNewer