Clone the uptime repository
$ git clone https://github.com/fzaninotto/uptime.git
Go into the newly cloned repository
$ cd uptime
Login using heroku command line
module WillPaginate | |
module ActionView | |
def will_paginate(collection = nil, options = {}) | |
options[:renderer] ||= BootstrapLinkRenderer | |
super.try :html_safe | |
end | |
class BootstrapLinkRenderer < LinkRenderer | |
protected |
Clone the uptime repository
$ git clone https://github.com/fzaninotto/uptime.git
Go into the newly cloned repository
$ cd uptime
Login using heroku command line
gem 'activerecord', '3.2.12' | |
require 'active_record' | |
require "minitest/autorun" | |
require 'minitest/pride' | |
require 'logger' | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveRecord::Schema.define do |
Coderunner is an app for OSX that makes it easy to run quick bits of code in a variety of languages. It is perfect for someone just experimenting with a particular language. For working with Ruby, I like to use RVM not only use different versions of Ruby, but also to create very specific gemsets. Getting this functionality to work with Coderunner proved a bit of challenge as the documentation is lacking, so I thought I would post the steps I took.
In this example, I will go through the setting up of a RVM environment for Ruby 1.8.7-p357 with a gemset called "my-gemset". I have already created the gemset for this example using the rvm 1.8.7@my-gemset --create
command. It is important to note that the RVM environment must be configured prior to applying the settings to Coderunner.
With the RVM environment setup, the next thing to do is open up the Coderunner preferences and look at the languages. There are quite a few
# java 7 | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install -y oracle-java7-installer | |
# osmosis | |
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.tgz | |
mkdir osmosis | |
tar -xvzf osmosis-latest.tgz -C osmosis |
def self.circle_path(center, radius, complete_path = false) | |
# For increased accuracy, if your data is in a localized area, add the elevation in meters to r_e below: | |
r_e = 6378137.0 | |
@@d2r ||= Math::PI/180 | |
@@multipliers ||= begin | |
segments = 16 | |
dRad = 2*Math::PI/segments | |
(segments + (complete_path ? 1 : 0)).times.map do |i| | |
rads = dRad*i | |
y = Math.sin(rads) |
console.log('Loading event'); | |
// Twilio Credentials | |
var accountSid = ''; | |
var authToken = ''; | |
var fromNumber = ''; | |
var https = require('https'); | |
var queryString = require('querystring'); |
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB(); | |
exports.handler = function(event, context) { | |
console.log("Request received:\n", JSON.stringify(event)); | |
console.log("Context received:\n", JSON.stringify(context)); | |
var tableName = "OurBlogDemo"; | |
var datetime = new Date().getTime().toString(); |
The official instructions for installing Nominatim are complete, but brief in places, and several steps must be changed in the Amazon Linux environment (which is roughly CentOS / Redhat). The steps below are rough record of what I did to get it working, but I didn't keep perfect track so you shouldn't rely on them as a shell script. Just follow each step, make sure it worked, and hopefully you'll need to adapt very little (version numbers, for one thing). (I also skip in and out of root, but you can be more careful if you like.)